[discount] merge
authorAsier Lostalé <asier.lostale@openbravo.com>
Mon, 29 Oct 2012 09:55:52 +0100
changeset 18370 f17e146cd0af
parent 18369 c63de4db35c1 (current diff)
parent 18280 4a27e27689bc (diff)
child 18371 110a850b5060
[discount] merge
src-db/database/sourcedata/AD_AUXILIARINPUT.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_FIELDGROUP.xml
src-db/database/sourcedata/AD_MENU.xml
src-db/database/sourcedata/AD_PROCESS.xml
src-db/database/sourcedata/AD_REFERENCE.xml
src-db/database/sourcedata/AD_REF_LIST.xml
src-db/database/sourcedata/AD_TAB.xml
src-db/database/sourcedata/AD_TABLE.xml
src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Product.java
src/org/openbravo/erpCommon/ad_callouts/SL_Order_Product.java
Binary file modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/UpdateRecordId2Value.class has changed
Binary file modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/UpdateRecordId2ValueData.class has changed
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/views/APRM_FINACC_TRANSACTION_ACCT_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/views/APRM_FINACC_TRANSACTION_ACCT_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,6 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW APRM_FINACC_TRANSACTION_ACCT_V">
-    <view name="APRM_FINACC_TRANSACTION_ACCT_V"><![CDATA[SELECT fact_acct.fact_acct_id AS fin_finacc_transaction_acct_id, fact_acct.ad_client_id, fact_acct.ad_org_id, fact_acct.isactive, fact_acct.created, fact_acct.createdby, fact_acct.updated, fact_acct.updatedby, fact_acct.c_acctschema_id, fact_acct.account_id AS c_elementvalue_id, fact_acct.datetrx, fact_acct.dateacct, fact_acct.c_period_id, fact_acct.ad_table_id, fact_acct.record_id AS fin_finacc_transaction_id, fin_finacc_transaction.fin_financial_account_id, fact_acct.gl_category_id, fact_acct.c_tax_id, fact_acct.m_locator_id, fact_acct.postingtype, fact_acct.c_currency_id, fact_acct.amtsourcedr, fact_acct.amtsourcecr, fact_acct.amtacctdr, fact_acct.amtacctcr, fact_acct.c_uom_id, fact_acct.qty, fact_acct.m_product_id, fact_acct.c_bpartner_id, fact_acct.ad_orgtrx_id, fact_acct.c_locfrom_id, fact_acct.c_locto_id, fact_acct.c_salesregion_id, fact_acct.c_project_id, fact_acct.c_campaign_id, fact_acct.c_activity_id, fact_acct.user1_id, fact_acct.user2_id, fact_acct.description, fact_acct.a_asset_id, fact_acct.fact_acct_group_id, fact_acct.seqno, fact_acct.factaccttype, fact_acct.docbasetype, fact_acct.acctvalue, fact_acct.acctdescription, fact_acct.c_withholding_id, fin_finacc_transaction.fin_finacc_transaction_id AS aprm_finacc_transaction_v_id
-FROM fact_acct, fin_finacc_transaction
-WHERE fact_acct.record_id = fin_finacc_transaction.fin_finacc_transaction_id AND fact_acct.ad_table_id = '4D8C3B3C31D1410DA046140C9F024D17']]></view>
+    <view name="APRM_FINACC_TRANSACTION_ACCT_V"><![CDATA[SELECT fact_acct.fact_acct_id AS fin_finacc_transaction_acct_id, fact_acct.ad_client_id, fact_acct.ad_org_id, fact_acct.isactive, fact_acct.created, fact_acct.createdby, fact_acct.updated, fact_acct.updatedby, fact_acct.c_acctschema_id, fact_acct.account_id AS c_elementvalue_id, fact_acct.datetrx, fact_acct.dateacct, fact_acct.c_period_id, fact_acct.ad_table_id, fact_acct.record_id AS fin_finacc_transaction_id, fin_finacc_transaction.fin_financial_account_id, fact_acct.gl_category_id, fact_acct.c_tax_id, fact_acct.m_locator_id, fact_acct.postingtype, fact_acct.c_currency_id, fact_acct.amtsourcedr, fact_acct.amtsourcecr, fact_acct.amtacctdr, fact_acct.amtacctcr, fact_acct.c_uom_id, fact_acct.qty, fact_acct.m_product_id, fact_acct.c_bpartner_id, fact_acct.ad_orgtrx_id, fact_acct.c_locfrom_id, fact_acct.c_locto_id, fact_acct.c_salesregion_id, fact_acct.c_project_id, fact_acct.c_campaign_id, fact_acct.c_activity_id, fact_acct.user1_id, fact_acct.user2_id, fact_acct.description, fact_acct.a_asset_id, fact_acct.fact_acct_group_id, fact_acct.seqno, fact_acct.factaccttype, fact_acct.docbasetype, fact_acct.acctvalue, fact_acct.acctdescription, fact_acct.c_withholding_id, fin_finacc_transaction.fin_finacc_transaction_id AS aprm_finacc_transaction_v_id FROM fact_acct, fin_finacc_transaction WHERE fact_acct.record_id = fin_finacc_transaction.fin_finacc_transaction_id AND fact_acct.ad_table_id = '4D8C3B3C31D1410DA046140C9F024D17']]></view>
   </database>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/views/APRM_FINACC_TRANSACTION_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/views/APRM_FINACC_TRANSACTION_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,13 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW APRM_FINACC_TRANSACTION_V">
-    <view name="APRM_FINACC_TRANSACTION_V"><![CDATA[SELECT trx.fin_finacc_transaction_id AS aprm_finacc_transaction_v_id, trx.fin_finacc_transaction_id, trx.ad_client_id, trx.ad_org_id, trx.isactive, trx.created, trx.createdby, trx.updated, trx.updatedby, trx.fin_financial_account_id, trx.line, trx.description, trx.statementdate, trx.trxtype, trx.fin_payment_id, trx.c_glitem_id, trx.depositamt, trx.paymentamt, trx.c_currency_id, trx.fin_reconciliation_id, trx.status, trx.createdbyalgorithm, trx.posted, trx.dateacct, trx.processed, trx.processing, trx.user1_id, trx.user2_id, trx.c_activity_id, trx.c_campaign_id, trx.c_project_id, trx.foreign_currency_id, trx.foreign_amount, trx.em_aprm_modify, trx.foreign_convert_rate, 
-CASE trx.status
-WHEN 'RPPC' THEN 'Y'
-ELSE 'N'
-END AS cleared, COALESCE(trx.c_bpartner_id, p.c_bpartner_id) AS c_bpartner_id, trx.m_product_id, trx.c_salesregion_id, p.documentno AS paymentdocno, COALESCE(r.processed, 'N') AS reconciled, 'N' AS delete_btn, (SELECT ad_table.ad_table_id
-FROM ad_table
-WHERE lower(ad_table.tablename) = 'fin_finacc_transaction') AS forced_table_id
-FROM fin_finacc_transaction trx
-LEFT JOIN fin_payment p ON trx.fin_payment_id = p.fin_payment_id
-LEFT JOIN fin_reconciliation r ON trx.fin_reconciliation_id = r.fin_reconciliation_id]]></view>
+    <view name="APRM_FINACC_TRANSACTION_V"><![CDATA[SELECT trx.fin_finacc_transaction_id AS aprm_finacc_transaction_v_id, trx.fin_finacc_transaction_id, trx.ad_client_id, trx.ad_org_id, trx.isactive, trx.created, trx.createdby, trx.updated, trx.updatedby, trx.fin_financial_account_id, trx.line, trx.description, trx.statementdate, trx.trxtype, trx.fin_payment_id, trx.c_glitem_id, trx.depositamt, trx.paymentamt, trx.c_currency_id, trx.fin_reconciliation_id, trx.status, trx.createdbyalgorithm, trx.posted, trx.dateacct, trx.processed, trx.processing, trx.user1_id, trx.user2_id, trx.c_activity_id, trx.c_campaign_id, trx.c_project_id, trx.foreign_currency_id, trx.foreign_amount, trx.em_aprm_modify, trx.foreign_convert_rate,  CASE trx.status WHEN 'RPPC' THEN 'Y' ELSE 'N' END AS cleared, COALESCE(trx.c_bpartner_id, p.c_bpartner_id) AS c_bpartner_id, trx.m_product_id, trx.c_salesregion_id, p.documentno AS paymentdocno, COALESCE(r.processed, 'N') AS reconciled, 'N' AS delete_btn, (SELECT ad_table.ad_table_id FROM ad_table WHERE lower(ad_table.tablename) = 'fin_finacc_transaction') AS forced_table_id FROM fin_finacc_transaction trx LEFT JOIN fin_payment p ON trx.fin_payment_id = p.fin_payment_id LEFT JOIN fin_reconciliation r ON trx.fin_reconciliation_id = r.fin_reconciliation_id]]></view>
   </database>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/views/APRM_FINACC_TRX_FULL_ACCT_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/views/APRM_FINACC_TRX_FULL_ACCT_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,26 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW APRM_FINACC_TRX_FULL_ACCT_V">
-    <view name="APRM_FINACC_TRX_FULL_ACCT_V"><![CDATA[SELECT fact_acct.fact_acct_id AS aprm_finacc_trx_full_acct_v_id, fact_acct.ad_client_id, fact_acct.ad_org_id, fact_acct.isactive, fact_acct.created, fact_acct.createdby, fact_acct.updated, fact_acct.updatedby, fact_acct.c_acctschema_id, fact_acct.account_id AS c_elementvalue_id, fact_acct.datetrx, fact_acct.dateacct, fact_acct.c_period_id, fact_acct.ad_table_id, 
-CASE
-WHEN fact_acct.ad_table_id = '4D8C3B3C31D1410DA046140C9F024D17' THEN fact_acct.record_id
-ELSE fact_acct.line_id
-END AS fin_finacc_transaction_id, 
-CASE
-WHEN fact_acct.ad_table_id = '4D8C3B3C31D1410DA046140C9F024D17' THEN NULL
-ELSE fact_acct.record_id
-END AS fin_reconciliation_id, 
-CASE
-WHEN fact_acct.ad_table_id = '4D8C3B3C31D1410DA046140C9F024D17' THEN NULL
-ELSE (SELECT fin_bankstatementline.fin_bankstatement_id
-FROM fin_bankstatementline
-WHERE fin_bankstatementline.fin_finacc_transaction_id = fact_acct.line_id)
-END AS fin_bankstatement_id, 
-CASE
-WHEN fact_acct.ad_table_id = '4D8C3B3C31D1410DA046140C9F024D17' THEN NULL
-ELSE (SELECT fin_bankstatementline.line
-FROM fin_bankstatementline
-WHERE fin_bankstatementline.fin_finacc_transaction_id = fact_acct.line_id)
-END AS line, fin_finacc_transaction.fin_financial_account_id, fact_acct.gl_category_id, fact_acct.c_tax_id, fact_acct.m_locator_id, fact_acct.postingtype, fact_acct.c_currency_id, fact_acct.amtsourcedr, fact_acct.amtsourcecr, fact_acct.amtacctdr, fact_acct.amtacctcr, fact_acct.c_uom_id, fact_acct.qty, fact_acct.m_product_id, fact_acct.c_bpartner_id, fact_acct.ad_orgtrx_id, fact_acct.c_locfrom_id, fact_acct.c_locto_id, fact_acct.c_salesregion_id, fact_acct.c_project_id, fact_acct.c_campaign_id, fact_acct.c_activity_id, fact_acct.user1_id, fact_acct.user2_id, fact_acct.description, fact_acct.a_asset_id, fact_acct.fact_acct_group_id, fact_acct.seqno, fact_acct.factaccttype, fact_acct.docbasetype, fact_acct.acctvalue, fact_acct.acctdescription, fact_acct.c_withholding_id
-FROM fact_acct, fin_finacc_transaction
-WHERE (fact_acct.record_id = fin_finacc_transaction.fin_finacc_transaction_id OR fact_acct.line_id = fin_finacc_transaction.fin_finacc_transaction_id) AND (fact_acct.ad_table_id IN ('4D8C3B3C31D1410DA046140C9F024D17', 'B1B7075C46934F0A9FD4C4D0F1457B42'))]]></view>
+    <view name="APRM_FINACC_TRX_FULL_ACCT_V"><![CDATA[SELECT fact_acct.fact_acct_id AS aprm_finacc_trx_full_acct_v_id, fact_acct.ad_client_id, fact_acct.ad_org_id, fact_acct.isactive, fact_acct.created, fact_acct.createdby, fact_acct.updated, fact_acct.updatedby, fact_acct.c_acctschema_id, fact_acct.account_id AS c_elementvalue_id, fact_acct.datetrx, fact_acct.dateacct, fact_acct.c_period_id, fact_acct.ad_table_id,  CASE WHEN fact_acct.ad_table_id = '4D8C3B3C31D1410DA046140C9F024D17' THEN fact_acct.record_id ELSE fact_acct.line_id END AS fin_finacc_transaction_id,  CASE WHEN fact_acct.ad_table_id = '4D8C3B3C31D1410DA046140C9F024D17' THEN NULL ELSE fact_acct.record_id END AS fin_reconciliation_id,  CASE WHEN fact_acct.ad_table_id = '4D8C3B3C31D1410DA046140C9F024D17' THEN NULL ELSE (SELECT fin_bankstatementline.fin_bankstatement_id FROM fin_bankstatementline WHERE fin_bankstatementline.fin_finacc_transaction_id = fact_acct.line_id) END AS fin_bankstatement_id,  CASE WHEN fact_acct.ad_table_id = '4D8C3B3C31D1410DA046140C9F024D17' THEN NULL ELSE (SELECT fin_bankstatementline.line FROM fin_bankstatementline WHERE fin_bankstatementline.fin_finacc_transaction_id = fact_acct.line_id) END AS line, fin_finacc_transaction.fin_financial_account_id, fact_acct.gl_category_id, fact_acct.c_tax_id, fact_acct.m_locator_id, fact_acct.postingtype, fact_acct.c_currency_id, fact_acct.amtsourcedr, fact_acct.amtsourcecr, fact_acct.amtacctdr, fact_acct.amtacctcr, fact_acct.c_uom_id, fact_acct.qty, fact_acct.m_product_id, fact_acct.c_bpartner_id, fact_acct.ad_orgtrx_id, fact_acct.c_locfrom_id, fact_acct.c_locto_id, fact_acct.c_salesregion_id, fact_acct.c_project_id, fact_acct.c_campaign_id, fact_acct.c_activity_id, fact_acct.user1_id, fact_acct.user2_id, fact_acct.description, fact_acct.a_asset_id, fact_acct.fact_acct_group_id, fact_acct.seqno, fact_acct.factaccttype, fact_acct.docbasetype, fact_acct.acctvalue, fact_acct.acctdescription, fact_acct.c_withholding_id FROM fact_acct, fin_finacc_transaction WHERE (fact_acct.record_id = fin_finacc_transaction.fin_finacc_transaction_id OR fact_acct.line_id = fin_finacc_transaction.fin_finacc_transaction_id) AND (fact_acct.ad_table_id IN ('4D8C3B3C31D1410DA046140C9F024D17', 'B1B7075C46934F0A9FD4C4D0F1457B42'))]]></view>
   </database>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/views/APRM_PAYMENT_PROP_PICK_EDIT.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/views/APRM_PAYMENT_PROP_PICK_EDIT.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,19 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW APRM_PAYMENT_PROP_PICK_EDIT">
-    <view name="APRM_PAYMENT_PROP_PICK_EDIT"><![CDATA[SELECT psd.fin_payment_scheduledetail_id AS aprm_payment_prop_pick_edit_id, psd.ad_client_id, psd.ad_org_id, psd.isactive, psd.created, psd.updated, psd.createdby, psd.updatedby, psd.fin_payment_scheduledetail_id, ppd.fin_payment_proposal_id, o.documentno AS order_documentno, i.documentno AS invoice_documentno, COALESCE(i.fin_paymentmethod_id, o.fin_paymentmethod_id) AS fin_paymentmethod_id, COALESCE(i.c_bpartner_id, o.c_bpartner_id) AS c_bpartner_id, COALESCE(psi.duedate, pso.duedate) AS duedate, i.grandtotal AS invoiced, COALESCE(psi.amount, pso.amount) AS expected, psd.amount AS outstanding, COALESCE(ppd.amount, 0) AS payment, COALESCE(psd.amount - ppd.amount, psd.amount) AS difference, 
-CASE
-WHEN ppd.writeoffamt <> 0 THEN 'Y'
-ELSE 'N'
-END AS writeoff, 
-CASE
-WHEN ppd.fin_payment_scheduledetail_id IS NULL THEN 'N'
-ELSE 'Y'
-END AS ob_selected, COALESCE(psi.fin_payment_priority_id, pso.fin_payment_priority_id) AS fin_payment_priority_id, COALESCE(i.c_currency_id, o.c_currency_id) AS c_currency_id, COALESCE(i.issotrx, o.issotrx) AS issotrx
-FROM fin_payment_scheduledetail psd
-LEFT JOIN fin_payment_prop_detail ppd ON psd.fin_payment_scheduledetail_id = ppd.fin_payment_scheduledetail_id
-LEFT JOIN fin_payment_schedule psi ON psd.fin_payment_schedule_invoice = psi.fin_payment_schedule_id
-LEFT JOIN fin_payment_schedule pso ON psd.fin_payment_schedule_order = pso.fin_payment_schedule_id
-LEFT JOIN c_invoice i ON psi.c_invoice_id = i.c_invoice_id
-LEFT JOIN c_order o ON pso.c_order_id = o.c_order_id
-WHERE psd.fin_payment_detail_id IS NULL]]></view>
+    <view name="APRM_PAYMENT_PROP_PICK_EDIT"><![CDATA[SELECT psd.fin_payment_scheduledetail_id AS aprm_payment_prop_pick_edit_id, psd.ad_client_id, psd.ad_org_id, psd.isactive, psd.created, psd.updated, psd.createdby, psd.updatedby, psd.fin_payment_scheduledetail_id, ppd.fin_payment_proposal_id, o.documentno AS order_documentno, i.documentno AS invoice_documentno, COALESCE(i.fin_paymentmethod_id, o.fin_paymentmethod_id) AS fin_paymentmethod_id, COALESCE(i.c_bpartner_id, o.c_bpartner_id) AS c_bpartner_id, COALESCE(psi.duedate, pso.duedate) AS duedate, i.grandtotal AS invoiced, COALESCE(psi.amount, pso.amount) AS expected, psd.amount AS outstanding, COALESCE(ppd.amount, 0) AS payment, COALESCE(psd.amount - ppd.amount, psd.amount) AS difference,  CASE WHEN ppd.writeoffamt <> 0 THEN 'Y' ELSE 'N' END AS writeoff,  CASE WHEN ppd.fin_payment_scheduledetail_id IS NULL THEN 'N' ELSE 'Y' END AS ob_selected, COALESCE(psi.fin_payment_priority_id, pso.fin_payment_priority_id) AS fin_payment_priority_id, COALESCE(i.c_currency_id, o.c_currency_id) AS c_currency_id, COALESCE(i.issotrx, o.issotrx) AS issotrx FROM fin_payment_scheduledetail psd LEFT JOIN fin_payment_prop_detail ppd ON psd.fin_payment_scheduledetail_id = ppd.fin_payment_scheduledetail_id LEFT JOIN fin_payment_schedule psi ON psd.fin_payment_schedule_invoice = psi.fin_payment_schedule_id LEFT JOIN fin_payment_schedule pso ON psd.fin_payment_schedule_order = pso.fin_payment_schedule_id LEFT JOIN c_invoice i ON psi.c_invoice_id = i.c_invoice_id LEFT JOIN c_order o ON pso.c_order_id = o.c_order_id WHERE psd.fin_payment_detail_id IS NULL]]></view>
   </database>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/views/APRM_RECONCILIATION_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/views/APRM_RECONCILIATION_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,30 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW APRM_RECONCILIATION_V">
-    <view name="APRM_RECONCILIATION_V"><![CDATA[SELECT fin_reconciliation.fin_reconciliation_id AS aprm_reconciliation_v_id, fin_reconciliation.fin_reconciliation_id, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive, fin_reconciliation.fin_financial_account_id, fin_reconciliation.documentno, fin_reconciliation.c_doctype_id, fin_reconciliation.dateto, fin_reconciliation.statementdate, fin_reconciliation.endingbalance, fin_reconciliation.startingbalance, fin_reconciliation.docstatus, fin_reconciliation.processing, fin_reconciliation.processed, fin_reconciliation.posted, fin_reconciliation.printdetailed, fin_reconciliation.em_aprm_process_reconciliation AS process_reconciliation, fin_reconciliation.printsummary, COALESCE(item.item_no, 0) AS item_no, COALESCE(item.item_amt, 0) AS item_amt, COALESCE(unrec.unrec_no, 0) AS unrec_no, COALESCE(unrec.unrec_amt, 0) AS unrec_amt, COALESCE(outstanding.payment_no, 0) AS payment_no, COALESCE(outstanding.payment_amt, 0) AS payment_amt, COALESCE(outstanding.deposit_no, 0) AS deposit_no, COALESCE(outstanding.deposit_amt, 0) AS deposit_amt, (SELECT ad_table.ad_table_id
-FROM ad_table
-WHERE lower(ad_table.tablename) = 'fin_reconciliation') AS forced_table_id
-FROM fin_reconciliation
-LEFT JOIN (SELECT fin_finacc_transaction.fin_reconciliation_id, count(*) AS item_no, COALESCE(sum(fin_finacc_transaction.depositamt - fin_finacc_transaction.paymentamt), 0) AS item_amt
-FROM fin_finacc_transaction
-GROUP BY fin_finacc_transaction.fin_reconciliation_id) item ON fin_reconciliation.fin_reconciliation_id = item.fin_reconciliation_id
-LEFT JOIN (SELECT fin_reconciliation.fin_reconciliation_id, count(*) AS unrec_no, COALESCE(sum(fin_bankstatementline.cramount - fin_bankstatementline.dramount), 0) AS unrec_amt
-FROM fin_bankstatementline, fin_bankstatement, fin_reconciliation
-WHERE (fin_bankstatementline.fin_finacc_transaction_id IS NULL OR (EXISTS (SELECT 1
-FROM fin_finacc_transaction, fin_reconciliation rec
-WHERE fin_finacc_transaction.fin_reconciliation_id = rec.fin_reconciliation_id AND fin_bankstatementline.fin_finacc_transaction_id = fin_finacc_transaction.fin_finacc_transaction_id AND fin_finacc_transaction.fin_financial_account_id = fin_bankstatement.fin_financial_account_id AND rec.created > fin_reconciliation.created))) AND fin_bankstatementline.datetrx <= fin_reconciliation.dateto AND fin_bankstatement.fin_bankstatement_id = fin_bankstatementline.fin_bankstatement_id AND fin_bankstatement.fin_financial_account_id = fin_reconciliation.fin_financial_account_id
-GROUP BY fin_reconciliation.fin_reconciliation_id) unrec ON fin_reconciliation.fin_reconciliation_id = unrec.fin_reconciliation_id
-LEFT JOIN (SELECT fin_reconciliation.fin_reconciliation_id, COALESCE(sum(
-CASE COALESCE(fin_finacc_transaction.paymentamt, 0)
-WHEN 0 THEN 0
-ELSE 1
-END), 0) AS payment_no, COALESCE(sum(fin_finacc_transaction.paymentamt), 0) AS payment_amt, COALESCE(sum(
-CASE COALESCE(fin_finacc_transaction.depositamt, 0)
-WHEN 0 THEN 0
-ELSE 1
-END), 0) AS deposit_no, COALESCE(sum(fin_finacc_transaction.depositamt), 0) AS deposit_amt
-FROM fin_finacc_transaction, fin_reconciliation
-WHERE (fin_finacc_transaction.fin_reconciliation_id IS NULL OR (EXISTS (SELECT 1
-FROM fin_reconciliation r
-WHERE r.dateto > fin_reconciliation.dateto AND fin_finacc_transaction.fin_reconciliation_id = r.fin_reconciliation_id))) AND fin_finacc_transaction.statementdate <= fin_reconciliation.dateto AND fin_finacc_transaction.fin_financial_account_id = fin_reconciliation.fin_financial_account_id
-GROUP BY fin_reconciliation.fin_reconciliation_id) outstanding ON fin_reconciliation.fin_reconciliation_id = outstanding.fin_reconciliation_id]]></view>
+    <view name="APRM_RECONCILIATION_V"><![CDATA[SELECT fin_reconciliation.fin_reconciliation_id AS aprm_reconciliation_v_id, fin_reconciliation.fin_reconciliation_id, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive, fin_reconciliation.fin_financial_account_id, fin_reconciliation.documentno, fin_reconciliation.c_doctype_id, fin_reconciliation.dateto, fin_reconciliation.statementdate, fin_reconciliation.endingbalance, fin_reconciliation.startingbalance, fin_reconciliation.docstatus, fin_reconciliation.processing, fin_reconciliation.processed, fin_reconciliation.posted, fin_reconciliation.printdetailed, fin_reconciliation.em_aprm_process_reconciliation AS process_reconciliation, fin_reconciliation.printsummary, COALESCE(item.item_no, 0) AS item_no, COALESCE(item.item_amt, 0) AS item_amt, COALESCE(unrec.unrec_no, 0) AS unrec_no, COALESCE(unrec.unrec_amt, 0) AS unrec_amt, COALESCE(outstanding.payment_no, 0) AS payment_no, COALESCE(outstanding.payment_amt, 0) AS payment_amt, COALESCE(outstanding.deposit_no, 0) AS deposit_no, COALESCE(outstanding.deposit_amt, 0) AS deposit_amt, (SELECT ad_table.ad_table_id FROM ad_table WHERE lower(ad_table.tablename) = 'fin_reconciliation') AS forced_table_id FROM fin_reconciliation LEFT JOIN (SELECT fin_finacc_transaction.fin_reconciliation_id, count(*) AS item_no, COALESCE(sum(fin_finacc_transaction.depositamt - fin_finacc_transaction.paymentamt), 0) AS item_amt FROM fin_finacc_transaction GROUP BY fin_finacc_transaction.fin_reconciliation_id) item ON fin_reconciliation.fin_reconciliation_id = item.fin_reconciliation_id LEFT JOIN (SELECT fin_reconciliation.fin_reconciliation_id, count(*) AS unrec_no, COALESCE(sum(fin_bankstatementline.cramount - fin_bankstatementline.dramount), 0) AS unrec_amt FROM fin_bankstatementline, fin_bankstatement, fin_reconciliation WHERE (fin_bankstatementline.fin_finacc_transaction_id IS NULL OR (EXISTS (SELECT 1 FROM fin_finacc_transaction, fin_reconciliation rec WHERE fin_finacc_transaction.fin_reconciliation_id = rec.fin_reconciliation_id AND fin_bankstatementline.fin_finacc_transaction_id = fin_finacc_transaction.fin_finacc_transaction_id AND fin_finacc_transaction.fin_financial_account_id = fin_bankstatement.fin_financial_account_id AND rec.created > fin_reconciliation.created))) AND fin_bankstatementline.datetrx <= fin_reconciliation.dateto AND fin_bankstatement.fin_bankstatement_id = fin_bankstatementline.fin_bankstatement_id AND fin_bankstatement.fin_financial_account_id = fin_reconciliation.fin_financial_account_id GROUP BY fin_reconciliation.fin_reconciliation_id) unrec ON fin_reconciliation.fin_reconciliation_id = unrec.fin_reconciliation_id LEFT JOIN (SELECT fin_reconciliation.fin_reconciliation_id, COALESCE(sum(CASE COALESCE(fin_finacc_transaction.paymentamt, 0) WHEN 0 THEN 0 ELSE 1 END), 0) AS payment_no, COALESCE(sum(fin_finacc_transaction.paymentamt), 0) AS payment_amt, COALESCE(sum(CASE COALESCE(fin_finacc_transaction.depositamt, 0) WHEN 0 THEN 0 ELSE 1 END), 0) AS deposit_no, COALESCE(sum(fin_finacc_transaction.depositamt), 0) AS deposit_amt FROM fin_finacc_transaction, fin_reconciliation WHERE (fin_finacc_transaction.fin_reconciliation_id IS NULL OR (EXISTS (SELECT 1 FROM fin_reconciliation r WHERE r.dateto > fin_reconciliation.dateto AND fin_finacc_transaction.fin_reconciliation_id = r.fin_reconciliation_id))) AND fin_finacc_transaction.statementdate <= fin_reconciliation.dateto AND fin_finacc_transaction.fin_financial_account_id = fin_reconciliation.fin_financial_account_id GROUP BY fin_reconciliation.fin_reconciliation_id) outstanding ON fin_reconciliation.fin_reconciliation_id = outstanding.fin_reconciliation_id]]></view>
   </database>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/views/APRM_REC_DETAIL_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/views/APRM_REC_DETAIL_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,36 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW APRM_REC_DETAIL_V">
-    <view name="APRM_REC_DETAIL_V"><![CDATA[((SELECT get_uuid() AS aprm_rec_detail_v_id, to_char('APRM_Reconciled') AS type, fin_finacc_transaction.fin_reconciliation_id, COALESCE(count(*), 0) AS item_no, COALESCE(sum(fin_finacc_transaction.depositamt - fin_finacc_transaction.paymentamt), 0) AS item_amt, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive
-FROM fin_finacc_transaction, fin_reconciliation
-WHERE fin_finacc_transaction.fin_reconciliation_id = fin_reconciliation.fin_reconciliation_id
-GROUP BY fin_finacc_transaction.fin_reconciliation_id, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive
-UNION ALL 
-SELECT get_uuid() AS aprm_rec_detail_v_id, to_char('APRM_UnReconciled') AS type, fin_reconciliation.fin_reconciliation_id, COALESCE(count(*), 0) AS item_no, COALESCE(sum(fin_bankstatementline.cramount - fin_bankstatementline.dramount), 0) AS item_amt, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive
-FROM fin_bankstatementline, fin_bankstatement, fin_reconciliation
-WHERE (fin_bankstatementline.fin_finacc_transaction_id IS NULL OR (EXISTS (SELECT 1
-FROM fin_finacc_transaction, fin_reconciliation rec
-WHERE fin_finacc_transaction.fin_reconciliation_id = rec.fin_reconciliation_id AND fin_bankstatementline.fin_finacc_transaction_id = fin_finacc_transaction.fin_finacc_transaction_id AND fin_finacc_transaction.fin_financial_account_id = fin_bankstatement.fin_financial_account_id AND rec.created > fin_reconciliation.created))) AND fin_bankstatementline.datetrx <= fin_reconciliation.dateto AND fin_bankstatement.fin_bankstatement_id = fin_bankstatementline.fin_bankstatement_id AND fin_bankstatement.fin_financial_account_id = fin_reconciliation.fin_financial_account_id
-GROUP BY fin_reconciliation.fin_reconciliation_id, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive)
-UNION ALL 
-SELECT get_uuid() AS aprm_rec_detail_v_id, to_char('APRM_OutstandingPayments') AS type, fin_reconciliation.fin_reconciliation_id, COALESCE(sum(
-CASE COALESCE(fin_finacc_transaction.paymentamt, 0)
-WHEN 0 THEN 0
-ELSE 1
-END), 0) AS item_no, COALESCE(sum(fin_finacc_transaction.paymentamt), 0) AS item_amt, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive
-FROM fin_finacc_transaction, fin_reconciliation
-WHERE (fin_finacc_transaction.fin_reconciliation_id IS NULL OR (EXISTS (SELECT 1
-FROM fin_reconciliation r
-WHERE r.dateto > fin_reconciliation.dateto AND fin_finacc_transaction.fin_reconciliation_id = r.fin_reconciliation_id))) AND fin_finacc_transaction.statementdate <= fin_reconciliation.dateto AND fin_finacc_transaction.fin_financial_account_id = fin_reconciliation.fin_financial_account_id
-GROUP BY fin_reconciliation.fin_reconciliation_id, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive)
-UNION ALL 
-SELECT get_uuid() AS aprm_rec_detail_v_id, to_char('APRM_OutstandingDeposits') AS type, fin_reconciliation.fin_reconciliation_id, COALESCE(sum(
-CASE COALESCE(fin_finacc_transaction.depositamt, 0)
-WHEN 0 THEN 0
-ELSE 1
-END), 0) AS item_no, COALESCE(sum(fin_finacc_transaction.depositamt), 0) AS item_amt, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive
-FROM fin_finacc_transaction, fin_reconciliation
-WHERE (fin_finacc_transaction.fin_reconciliation_id IS NULL OR (EXISTS (SELECT 1
-FROM fin_reconciliation r
-WHERE r.dateto > fin_reconciliation.dateto AND fin_finacc_transaction.fin_reconciliation_id = r.fin_reconciliation_id))) AND fin_finacc_transaction.statementdate <= fin_reconciliation.dateto AND fin_finacc_transaction.fin_financial_account_id = fin_reconciliation.fin_financial_account_id
-GROUP BY fin_reconciliation.fin_reconciliation_id, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive]]></view>
+    <view name="APRM_REC_DETAIL_V"><![CDATA[((SELECT get_uuid() AS aprm_rec_detail_v_id, to_char('APRM_Reconciled') AS type, fin_finacc_transaction.fin_reconciliation_id, COALESCE(count(*), 0) AS item_no, COALESCE(sum(fin_finacc_transaction.depositamt - fin_finacc_transaction.paymentamt), 0) AS item_amt, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive FROM fin_finacc_transaction, fin_reconciliation WHERE fin_finacc_transaction.fin_reconciliation_id = fin_reconciliation.fin_reconciliation_id GROUP BY fin_finacc_transaction.fin_reconciliation_id, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive UNION ALL  SELECT get_uuid() AS aprm_rec_detail_v_id, to_char('APRM_UnReconciled') AS type, fin_reconciliation.fin_reconciliation_id, COALESCE(count(*), 0) AS item_no, COALESCE(sum(fin_bankstatementline.cramount - fin_bankstatementline.dramount), 0) AS item_amt, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive FROM fin_bankstatementline, fin_bankstatement, fin_reconciliation WHERE (fin_bankstatementline.fin_finacc_transaction_id IS NULL OR (EXISTS (SELECT 1 FROM fin_finacc_transaction, fin_reconciliation rec WHERE fin_finacc_transaction.fin_reconciliation_id = rec.fin_reconciliation_id AND fin_bankstatementline.fin_finacc_transaction_id = fin_finacc_transaction.fin_finacc_transaction_id AND fin_finacc_transaction.fin_financial_account_id = fin_bankstatement.fin_financial_account_id AND rec.created > fin_reconciliation.created))) AND fin_bankstatementline.datetrx <= fin_reconciliation.dateto AND fin_bankstatement.fin_bankstatement_id = fin_bankstatementline.fin_bankstatement_id AND fin_bankstatement.fin_financial_account_id = fin_reconciliation.fin_financial_account_id GROUP BY fin_reconciliation.fin_reconciliation_id, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive) UNION ALL  SELECT get_uuid() AS aprm_rec_detail_v_id, to_char('APRM_OutstandingPayments') AS type, fin_reconciliation.fin_reconciliation_id, COALESCE(sum(CASE COALESCE(fin_finacc_transaction.paymentamt, 0) WHEN 0 THEN 0 ELSE 1 END), 0) AS item_no, COALESCE(sum(fin_finacc_transaction.paymentamt), 0) AS item_amt, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive FROM fin_finacc_transaction, fin_reconciliation WHERE (fin_finacc_transaction.fin_reconciliation_id IS NULL OR (EXISTS (SELECT 1 FROM fin_reconciliation r WHERE r.dateto > fin_reconciliation.dateto AND fin_finacc_transaction.fin_reconciliation_id = r.fin_reconciliation_id))) AND fin_finacc_transaction.statementdate <= fin_reconciliation.dateto AND fin_finacc_transaction.fin_financial_account_id = fin_reconciliation.fin_financial_account_id GROUP BY fin_reconciliation.fin_reconciliation_id, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive) UNION ALL  SELECT get_uuid() AS aprm_rec_detail_v_id, to_char('APRM_OutstandingDeposits') AS type, fin_reconciliation.fin_reconciliation_id, COALESCE(sum(CASE COALESCE(fin_finacc_transaction.depositamt, 0) WHEN 0 THEN 0 ELSE 1 END), 0) AS item_no, COALESCE(sum(fin_finacc_transaction.depositamt), 0) AS item_amt, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive FROM fin_finacc_transaction, fin_reconciliation WHERE (fin_finacc_transaction.fin_reconciliation_id IS NULL OR (EXISTS (SELECT 1 FROM fin_reconciliation r WHERE r.dateto > fin_reconciliation.dateto AND fin_finacc_transaction.fin_reconciliation_id = r.fin_reconciliation_id))) AND fin_finacc_transaction.statementdate <= fin_reconciliation.dateto AND fin_finacc_transaction.fin_financial_account_id = fin_reconciliation.fin_financial_account_id GROUP BY fin_reconciliation.fin_reconciliation_id, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive]]></view>
   </database>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -11974,7 +11974,8 @@
 <!--B14B509740E785BBE040A8C0916624A4-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--B14B509740E785BBE040A8C0916624A4-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--B14B509740E785BBE040A8C0916624A4-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--B14B509740E785BBE040A8C0916624A4-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[Y]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--B14B509740E785BBE040A8C0916624A4-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--B14B509740E785BBE040A8C0916624A4-->  <EM_OBUIAPP_SUMMARYFN><![CDATA[sum]]></EM_OBUIAPP_SUMMARYFN>
 <!--B14B509740E785BBE040A8C0916624A4--></AD_FIELD>
 
 <!--B14B509740E885BBE040A8C0916624A4--><AD_FIELD>
@@ -12029,7 +12030,8 @@
 <!--B14B509740E985BBE040A8C0916624A4-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--B14B509740E985BBE040A8C0916624A4-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
 <!--B14B509740E985BBE040A8C0916624A4-->  <EM_OBUIAPP_VALIDATOR><![CDATA[OB.APRM.validateModifyPaymentPlanAmounts]]></EM_OBUIAPP_VALIDATOR>
-<!--B14B509740E985BBE040A8C0916624A4-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[Y]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--B14B509740E985BBE040A8C0916624A4-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--B14B509740E985BBE040A8C0916624A4-->  <EM_OBUIAPP_SUMMARYFN><![CDATA[sum]]></EM_OBUIAPP_SUMMARYFN>
 <!--B14B509740E985BBE040A8C0916624A4--></AD_FIELD>
 
 <!--B14B509740EA85BBE040A8C0916624A4--><AD_FIELD>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 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.18210]]></VERSION>
+<!--A918E3331C404B889D69AA9BFAFB23AC-->  <VERSION><![CDATA[3.0.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 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.18210]]></STARTVERSION>
+<!--89326AE95DAD449D85DFAB2C5B1C6683-->  <STARTVERSION><![CDATA[2.1.18279]]></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.18210]]></STARTVERSION>
+<!--B97FC854C6DD41E692161585645A900F-->  <STARTVERSION><![CDATA[3.0.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_REFERENCE.xml	Mon Oct 29 09:55:52 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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_REF_LIST.xml	Mon Oct 29 09:55:52 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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Mon Oct 29 09:55:52 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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Mon Oct 29 09:55:52 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-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateRecordId2Value.java	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateRecordId2Value.java	Mon Oct 29 09:55:52 2012 +0100
@@ -31,7 +31,9 @@
   public void execute() {
     try {
       ConnectionProvider cp = getConnectionProvider();
-      UpdateRecordId2ValueData.update(cp);
+      if(UpdateRecordId2ValueData.selectCheck(cp)){
+        UpdateRecordId2ValueData.update(cp);
+      }
     } catch (Exception e) {
       handleError(e);
     }
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateRecordId2Value_data.xsql	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateRecordId2Value_data.xsql	Mon Oct 29 09:55:52 2012 +0100
@@ -27,12 +27,24 @@
       ]]>
     </Sql>
   </SqlMethod>
+  <SqlMethod name="selectCheck" type="preparedStatement" return="boolean">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+        SELECT count(1) as name from dual
+        WHERE EXISTS(SELECT 1 FROM FACT_ACCT 
+        WHERE NOT EXISTS (SELECT 1 FROM C_DEBT_PAYMENT WHERE C_DEBT_PAYMENT_ID = RECORD_ID2)
+        AND RECORD_ID2 IS NOT NULL)
+      ]]>
+    </Sql>
+  </SqlMethod>
   <SqlMethod name="update" type="preparedStatement" return="rowCount">
     <SqlMethodComment></SqlMethodComment>
     <Sql>
       <![CDATA[
         UPDATE FACT_ACCT SET RECORD_ID2 = NULL 
         WHERE NOT EXISTS (SELECT 1 FROM C_DEBT_PAYMENT WHERE C_DEBT_PAYMENT_ID = RECORD_ID2)
+        AND RECORD_ID2 IS NOT NULL
       ]]>
     </Sql>
   </SqlMethod>
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateRecordId2ValueData.java	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateRecordId2ValueData.java	Mon Oct 29 09:55:52 2012 +0100
@@ -22,7 +22,7 @@
   }
 
   public String getField(String fieldName) {
-    if (fieldName.equalsIgnoreCase("name"))
+    if (fieldName.equalsIgnoreCase("NAME"))
       return name;
    else {
      log4j.debug("Field does not exist: " + fieldName);
@@ -57,7 +57,7 @@
       while(continueResult && result.next()) {
         countRecord++;
         UpdateRecordId2ValueData objectUpdateRecordId2ValueData = new UpdateRecordId2ValueData();
-        objectUpdateRecordId2ValueData.name = UtilSql.getValue(result, "name");
+        objectUpdateRecordId2ValueData.name = UtilSql.getValue(result, "NAME");
         objectUpdateRecordId2ValueData.InitRecordNumber = Integer.toString(firstRegister);
         vector.addElement(objectUpdateRecordId2ValueData);
         if (countRecord >= numberRegisters && numberRegisters != 0) {
@@ -83,11 +83,48 @@
     return(objectUpdateRecordId2ValueData);
   }
 
+  public static boolean selectCheck(ConnectionProvider connectionProvider)    throws ServletException {
+    String strSql = "";
+    strSql = strSql + 
+      "        SELECT count(1) as name from dual" +
+      "        WHERE EXISTS(SELECT 1 FROM FACT_ACCT " +
+      "        WHERE NOT EXISTS (SELECT 1 FROM C_DEBT_PAYMENT WHERE C_DEBT_PAYMENT_ID = RECORD_ID2)" +
+      "        AND RECORD_ID2 IS NOT NULL)";
+
+    ResultSet result;
+    boolean boolReturn = false;
+    PreparedStatement st = null;
+
+    try {
+    st = connectionProvider.getPreparedStatement(strSql);
+
+      result = st.executeQuery();
+      if(result.next()) {
+        boolReturn = !UtilSql.getValue(result, "NAME").equals("0");
+      }
+      result.close();
+    } catch(SQLException e){
+      log4j.error("SQL error in query: " + strSql + "Exception:"+ e);
+      throw new ServletException("@CODE=" + Integer.toString(e.getErrorCode()) + "@" + e.getMessage());
+    } catch(Exception ex){
+      log4j.error("Exception in query: " + strSql + "Exception:"+ ex);
+      throw new ServletException("@CODE=@" + ex.getMessage());
+    } finally {
+      try {
+        connectionProvider.releasePreparedStatement(st);
+      } catch(Exception ignore){
+        ignore.printStackTrace();
+      }
+    }
+    return(boolReturn);
+  }
+
   public static int update(ConnectionProvider connectionProvider)    throws ServletException {
     String strSql = "";
     strSql = strSql + 
       "        UPDATE FACT_ACCT SET RECORD_ID2 = NULL " +
-      "        WHERE NOT EXISTS (SELECT 1 FROM C_DEBT_PAYMENT WHERE C_DEBT_PAYMENT_ID = RECORD_ID2)";
+      "        WHERE NOT EXISTS (SELECT 1 FROM C_DEBT_PAYMENT WHERE C_DEBT_PAYMENT_ID = RECORD_ID2)" +
+      "        AND RECORD_ID2 IS NOT NULL";
 
     int updateCount = 0;
     PreparedStatement st = null;
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.html	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.html	Mon Oct 29 09:55:52 2012 +0100
@@ -98,11 +98,14 @@
       keepSelection = true;
     }
     for (i = 0; i < total; i++) {
-      if (chk[i].checked && keepSelection) {
-        continue;
-      }
       scheduledPaymentDetailId = frm.elements["inpRecordId" + i].value;
       outstandingAmount = frm.elements["inpRecordAmt" + scheduledPaymentDetailId].value;
+      if (chk[i].checked && keepSelection) {
+        if(compare(outstandingAmount, '<', amount) && compare(distributedAmount, '==', outstandingAmount))
+    	  continue;
+        else
+          amount = add(amount, frm.elements["inpPaymentAmount" + chk[i].value].value);
+      }
       if ( compare(outstandingAmount, '>', amount) ) {
         outstandingAmount = amount;
       }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromInvoice.html	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromInvoice.html	Mon Oct 29 09:55:52 2012 +0100
@@ -468,7 +468,6 @@
     try {
       if (XMLHttpRequestObj.responseText) {
     	strText = XMLHttpRequestObj.responseText;
-    	debugger;
         createCombo(document.getElementById('paramActionDocument'), strText);
 	    document.getElementById('client_top_popup').style.display = 'block';
         document.getElementById('client_top').style.display = 'none';
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromTransaction.html	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromTransaction.html	Mon Oct 29 09:55:52 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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromTransaction.java	Mon Oct 29 09:55:52 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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromTransaction.xml	Mon Oct 29 09:55:52 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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddTransaction.html	Mon Oct 29 09:55:52 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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddTransaction.java	Mon Oct 29 09:55:52 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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddTransaction.xml	Mon Oct 29 09:55:52 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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.html	Mon Oct 29 09:55:52 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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.java	Mon Oct 29 09:55:52 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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java	Mon Oct 29 09:55:52 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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/MatchTransactionDao.java	Mon Oct 29 09:55:52 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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/event/FIN_PaymentEventListener.java	Mon Oct 29 09:55:52 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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_BankStatementProcess.java	Mon Oct 29 09:55:52 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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java	Mon Oct 29 09:55:52 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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Mon Oct 29 09:55:52 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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 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.18210]]></VERSION>
+<!--C70732EA90A14EC0916078B85CC33D2D-->  <VERSION><![CDATA[1.1.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 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.18210]]></STARTVERSION>
+<!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <STARTVERSION><![CDATA[3.0.18279]]></STARTVERSION>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <DEPENDANT_MODULE_NAME><![CDATA[Core]]></DEPENDANT_MODULE_NAME>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/model/triggers/OBUIAPP_AD_FIELD_MOD_TRG.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+  <database name="TRIGGER OBUIAPP_AD_FIELD_MOD_TRG">
+    <trigger name="OBUIAPP_AD_FIELD_MOD_TRG" table="AD_FIELD" fires="before" insert="true" update="true" delete="true" foreach="row">
+      <body><![CDATA[
+
+/*************************************************************************
+* The contents of this file are subject to the Openbravo  Public  License
+* Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+* Version 1.1  with a permitted attribution clause; you may not  use this
+* file except in compliance with the License. You  may  obtain  a copy of
+* the License at http://www.openbravo.com/legal/license.html
+* Software distributed under the License  is  distributed  on  an "AS IS"
+* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+* License for the specific  language  governing  rights  and  limitations
+* under the License.
+* The Original Code is Openbravo ERP.
+* The Initial Developer of the Original Code is Openbravo SLU
+* All portions are Copyright (C) 2012 Openbravo SLU
+* All Rights Reserved.
+* Contributor(s):  ______________________________________.
+************************************************************************/
+  devTemplate NUMBER;
+  devModule   CHAR(1);
+  cuerrentModuleID  VARCHAR2(32);
+  vAux NUMBER;
+    
+BEGIN
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
+    END IF;
+
+  SELECT COUNT(*)
+    INTO devTemplate
+    FROM AD_MODULE
+   WHERE IsInDevelopment = 'Y'
+     AND Type = 'T';
+     
+  IF (UPDATING OR INSERTING) THEN
+    cuerrentModuleID := :new.AD_Module_ID;
+  ELSE
+    cuerrentModuleID := :old.AD_Module_ID;
+  END IF;
+  
+  SELECT M.IsInDevelopment
+    INTO devModule
+    FROM AD_MODULE M
+   WHERE M.AD_MODULE_ID = cuerrentModuleID;
+     
+  IF (UPDATING AND devTemplate=0 AND devModule='N') THEN
+    IF (
+        COALESCE(:NEW.EM_OBUIAPP_ROWSPAN , 1) != COALESCE(:OLD.EM_OBUIAPP_ROWSPAN , 1) OR
+        COALESCE(:NEW.EM_OBUIAPP_VALIDATOR , '.') != COALESCE(:OLD.EM_OBUIAPP_VALIDATOR , '.') OR
+        COALESCE(:NEW.EM_OBUIAPP_SHOWSUMMARY , '.') != COALESCE(:OLD.EM_OBUIAPP_SHOWSUMMARY , '.') OR
+        COALESCE(:NEW.EM_OBUIAPP_SUMMARYFN , '.') != COALESCE(:OLD.EM_OBUIAPP_SUMMARYFN , '.') OR
+        1=2) THEN
+      RAISE_APPLICATION_ERROR(-20000, '@20532@');
+    END IF;
+  END IF;
+END OBUIAPP_AD_FIELD_MOD_TRG
+]]></body>
+    </trigger>
+  </database>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_COLUMN.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_COLUMN.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -812,7 +812,7 @@
 <!--1BA0AE21034E4339A76C7709E0DF206F-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
 <!--1BA0AE21034E4339A76C7709E0DF206F-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
 <!--1BA0AE21034E4339A76C7709E0DF206F-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
-<!--1BA0AE21034E4339A76C7709E0DF206F-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--1BA0AE21034E4339A76C7709E0DF206F-->  <DEVELOPMENTSTATUS><![CDATA[DP]]></DEVELOPMENTSTATUS>
 <!--1BA0AE21034E4339A76C7709E0DF206F-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--1BA0AE21034E4339A76C7709E0DF206F-->  <POSITION><![CDATA[39]]></POSITION>
 <!--1BA0AE21034E4339A76C7709E0DF206F-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_FIELD.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_FIELD.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -377,34 +377,6 @@
 <!--0CFC553FC6ED43B8B211EBDAEC57F527-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--0CFC553FC6ED43B8B211EBDAEC57F527--></AD_FIELD>
 
-<!--0D421A462066434B9040D2F3A67FA8E3--><AD_FIELD>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <AD_FIELD_ID><![CDATA[0D421A462066434B9040D2F3A67FA8E3]]></AD_FIELD_ID>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <NAME><![CDATA[Show Summary]]></NAME>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <DESCRIPTION><![CDATA[Show Summary]]></DESCRIPTION>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <HELP><![CDATA[Defines if the Field should show a summary function at the end of the grid]]></HELP>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <AD_TAB_ID><![CDATA[107]]></AD_TAB_ID>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <AD_COLUMN_ID><![CDATA[1BA0AE21034E4339A76C7709E0DF206F]]></AD_COLUMN_ID>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <SEQNO><![CDATA[240]]></SEQNO>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--0D421A462066434B9040D2F3A67FA8E3-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
-<!--0D421A462066434B9040D2F3A67FA8E3--></AD_FIELD>
-
 <!--0D7D1CCBA5E54A66A433D37759D2C074--><AD_FIELD>
 <!--0D7D1CCBA5E54A66A433D37759D2C074-->  <AD_FIELD_ID><![CDATA[0D7D1CCBA5E54A66A433D37759D2C074]]></AD_FIELD_ID>
 <!--0D7D1CCBA5E54A66A433D37759D2C074-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -22,6 +22,17 @@
 <!--02727C95034C407789ED4C1A86AAC58C-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--02727C95034C407789ED4C1A86AAC58C--></AD_MESSAGE>
 
+<!--03A1537560E14203A0FE2C2CF9DB3D97--><AD_MESSAGE>
+<!--03A1537560E14203A0FE2C2CF9DB3D97-->  <AD_MESSAGE_ID><![CDATA[03A1537560E14203A0FE2C2CF9DB3D97]]></AD_MESSAGE_ID>
+<!--03A1537560E14203A0FE2C2CF9DB3D97-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--03A1537560E14203A0FE2C2CF9DB3D97-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--03A1537560E14203A0FE2C2CF9DB3D97-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--03A1537560E14203A0FE2C2CF9DB3D97-->  <VALUE><![CDATA[OBUIAPP_GroupBy10000]]></VALUE>
+<!--03A1537560E14203A0FE2C2CF9DB3D97-->  <MSGTEXT><![CDATA[By 10000]]></MSGTEXT>
+<!--03A1537560E14203A0FE2C2CF9DB3D97-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--03A1537560E14203A0FE2C2CF9DB3D97-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--03A1537560E14203A0FE2C2CF9DB3D97--></AD_MESSAGE>
+
 <!--03E29095BED24FDDA971405ABA990CAD--><AD_MESSAGE>
 <!--03E29095BED24FDDA971405ABA990CAD-->  <AD_MESSAGE_ID><![CDATA[03E29095BED24FDDA971405ABA990CAD]]></AD_MESSAGE_ID>
 <!--03E29095BED24FDDA971405ABA990CAD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -33,6 +44,28 @@
 <!--03E29095BED24FDDA971405ABA990CAD-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--03E29095BED24FDDA971405ABA990CAD--></AD_MESSAGE>
 
+<!--040345BC5EEE4998936537D8474BEDF0--><AD_MESSAGE>
+<!--040345BC5EEE4998936537D8474BEDF0-->  <AD_MESSAGE_ID><![CDATA[040345BC5EEE4998936537D8474BEDF0]]></AD_MESSAGE_ID>
+<!--040345BC5EEE4998936537D8474BEDF0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--040345BC5EEE4998936537D8474BEDF0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--040345BC5EEE4998936537D8474BEDF0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--040345BC5EEE4998936537D8474BEDF0-->  <VALUE><![CDATA[OBUIAPP_SummaryFunctionMax]]></VALUE>
+<!--040345BC5EEE4998936537D8474BEDF0-->  <MSGTEXT><![CDATA[Max]]></MSGTEXT>
+<!--040345BC5EEE4998936537D8474BEDF0-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--040345BC5EEE4998936537D8474BEDF0-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--040345BC5EEE4998936537D8474BEDF0--></AD_MESSAGE>
+
+<!--04A912EBB5154048961E21EF15380D4A--><AD_MESSAGE>
+<!--04A912EBB5154048961E21EF15380D4A-->  <AD_MESSAGE_ID><![CDATA[04A912EBB5154048961E21EF15380D4A]]></AD_MESSAGE_ID>
+<!--04A912EBB5154048961E21EF15380D4A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--04A912EBB5154048961E21EF15380D4A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--04A912EBB5154048961E21EF15380D4A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--04A912EBB5154048961E21EF15380D4A-->  <VALUE><![CDATA[OBUIAPP_MaxGroupingReached]]></VALUE>
+<!--04A912EBB5154048961E21EF15380D4A-->  <MSGTEXT><![CDATA[There are more than %0 records, grouping is disabled for larger datasets.]]></MSGTEXT>
+<!--04A912EBB5154048961E21EF15380D4A-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--04A912EBB5154048961E21EF15380D4A-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--04A912EBB5154048961E21EF15380D4A--></AD_MESSAGE>
+
 <!--07272FCDEEA64054AF2F983D9814EE00--><AD_MESSAGE>
 <!--07272FCDEEA64054AF2F983D9814EE00-->  <AD_MESSAGE_ID><![CDATA[07272FCDEEA64054AF2F983D9814EE00]]></AD_MESSAGE_ID>
 <!--07272FCDEEA64054AF2F983D9814EE00-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -154,6 +187,17 @@
 <!--165D4AB1311A477C8F95184C0A9F4B2F-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--165D4AB1311A477C8F95184C0A9F4B2F--></AD_MESSAGE>
 
+<!--1B783EC678E644E385778D2D7D25A97B--><AD_MESSAGE>
+<!--1B783EC678E644E385778D2D7D25A97B-->  <AD_MESSAGE_ID><![CDATA[1B783EC678E644E385778D2D7D25A97B]]></AD_MESSAGE_ID>
+<!--1B783EC678E644E385778D2D7D25A97B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1B783EC678E644E385778D2D7D25A97B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1B783EC678E644E385778D2D7D25A97B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1B783EC678E644E385778D2D7D25A97B-->  <VALUE><![CDATA[OBUIAPP_ungroup]]></VALUE>
+<!--1B783EC678E644E385778D2D7D25A97B-->  <MSGTEXT><![CDATA[Ungroup]]></MSGTEXT>
+<!--1B783EC678E644E385778D2D7D25A97B-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--1B783EC678E644E385778D2D7D25A97B-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--1B783EC678E644E385778D2D7D25A97B--></AD_MESSAGE>
+
 <!--1C8D1970AE9A46319D42430A0D0AAF09--><AD_MESSAGE>
 <!--1C8D1970AE9A46319D42430A0D0AAF09-->  <AD_MESSAGE_ID><![CDATA[1C8D1970AE9A46319D42430A0D0AAF09]]></AD_MESSAGE_ID>
 <!--1C8D1970AE9A46319D42430A0D0AAF09-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -288,6 +332,17 @@
 <!--42181711B0664B9A898BDE8754ADA4E0-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--42181711B0664B9A898BDE8754ADA4E0--></AD_MESSAGE>
 
+<!--48A6793A3C364216B184A33117EF7ED1--><AD_MESSAGE>
+<!--48A6793A3C364216B184A33117EF7ED1-->  <AD_MESSAGE_ID><![CDATA[48A6793A3C364216B184A33117EF7ED1]]></AD_MESSAGE_ID>
+<!--48A6793A3C364216B184A33117EF7ED1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--48A6793A3C364216B184A33117EF7ED1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--48A6793A3C364216B184A33117EF7ED1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--48A6793A3C364216B184A33117EF7ED1-->  <VALUE><![CDATA[OBUIAPP_GroupByDecimal10]]></VALUE>
+<!--48A6793A3C364216B184A33117EF7ED1-->  <MSGTEXT><![CDATA[By 0.1]]></MSGTEXT>
+<!--48A6793A3C364216B184A33117EF7ED1-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--48A6793A3C364216B184A33117EF7ED1-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--48A6793A3C364216B184A33117EF7ED1--></AD_MESSAGE>
+
 <!--49C1D2F7A3F9442482B27EBD450BBA40--><AD_MESSAGE>
 <!--49C1D2F7A3F9442482B27EBD450BBA40-->  <AD_MESSAGE_ID><![CDATA[49C1D2F7A3F9442482B27EBD450BBA40]]></AD_MESSAGE_ID>
 <!--49C1D2F7A3F9442482B27EBD450BBA40-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -343,6 +398,17 @@
 <!--51FF106EA92C4D5AB7310A32ED2A6D79-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--51FF106EA92C4D5AB7310A32ED2A6D79--></AD_MESSAGE>
 
+<!--52FC93FB2DEC4C168D14E65195F97752--><AD_MESSAGE>
+<!--52FC93FB2DEC4C168D14E65195F97752-->  <AD_MESSAGE_ID><![CDATA[52FC93FB2DEC4C168D14E65195F97752]]></AD_MESSAGE_ID>
+<!--52FC93FB2DEC4C168D14E65195F97752-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--52FC93FB2DEC4C168D14E65195F97752-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--52FC93FB2DEC4C168D14E65195F97752-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--52FC93FB2DEC4C168D14E65195F97752-->  <VALUE><![CDATA[OBUIAPP_SetSummaryFunction]]></VALUE>
+<!--52FC93FB2DEC4C168D14E65195F97752-->  <MSGTEXT><![CDATA[Set Summary Function]]></MSGTEXT>
+<!--52FC93FB2DEC4C168D14E65195F97752-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--52FC93FB2DEC4C168D14E65195F97752-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--52FC93FB2DEC4C168D14E65195F97752--></AD_MESSAGE>
+
 <!--5B1FB06A4EBA4654A9A93695434C72AE--><AD_MESSAGE>
 <!--5B1FB06A4EBA4654A9A93695434C72AE-->  <AD_MESSAGE_ID><![CDATA[5B1FB06A4EBA4654A9A93695434C72AE]]></AD_MESSAGE_ID>
 <!--5B1FB06A4EBA4654A9A93695434C72AE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -354,6 +420,28 @@
 <!--5B1FB06A4EBA4654A9A93695434C72AE-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--5B1FB06A4EBA4654A9A93695434C72AE--></AD_MESSAGE>
 
+<!--5DE5F76ED5B4497FACDC438893037484--><AD_MESSAGE>
+<!--5DE5F76ED5B4497FACDC438893037484-->  <AD_MESSAGE_ID><![CDATA[5DE5F76ED5B4497FACDC438893037484]]></AD_MESSAGE_ID>
+<!--5DE5F76ED5B4497FACDC438893037484-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--5DE5F76ED5B4497FACDC438893037484-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--5DE5F76ED5B4497FACDC438893037484-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--5DE5F76ED5B4497FACDC438893037484-->  <VALUE><![CDATA[OBUIAPP_SetSummaryFunction_Description]]></VALUE>
+<!--5DE5F76ED5B4497FACDC438893037484-->  <MSGTEXT><![CDATA[Set the summary function which is used to compute/show a separate summary row.]]></MSGTEXT>
+<!--5DE5F76ED5B4497FACDC438893037484-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--5DE5F76ED5B4497FACDC438893037484-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--5DE5F76ED5B4497FACDC438893037484--></AD_MESSAGE>
+
+<!--61D57958CEF64A7BA613DB200531AF36--><AD_MESSAGE>
+<!--61D57958CEF64A7BA613DB200531AF36-->  <AD_MESSAGE_ID><![CDATA[61D57958CEF64A7BA613DB200531AF36]]></AD_MESSAGE_ID>
+<!--61D57958CEF64A7BA613DB200531AF36-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--61D57958CEF64A7BA613DB200531AF36-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--61D57958CEF64A7BA613DB200531AF36-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--61D57958CEF64A7BA613DB200531AF36-->  <VALUE><![CDATA[OBUIAPP_SummaryFunctionAvg]]></VALUE>
+<!--61D57958CEF64A7BA613DB200531AF36-->  <MSGTEXT><![CDATA[Avg]]></MSGTEXT>
+<!--61D57958CEF64A7BA613DB200531AF36-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--61D57958CEF64A7BA613DB200531AF36-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--61D57958CEF64A7BA613DB200531AF36--></AD_MESSAGE>
+
 <!--6267D26C10A84572BBA5B3360F847E65--><AD_MESSAGE>
 <!--6267D26C10A84572BBA5B3360F847E65-->  <AD_MESSAGE_ID><![CDATA[6267D26C10A84572BBA5B3360F847E65]]></AD_MESSAGE_ID>
 <!--6267D26C10A84572BBA5B3360F847E65-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -398,6 +486,17 @@
 <!--6831E84EB2124F08B3FCEF6F50CF8AD1-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--6831E84EB2124F08B3FCEF6F50CF8AD1--></AD_MESSAGE>
 
+<!--6C6BCBC5C75F449CAD5A8182866FF9D9--><AD_MESSAGE>
+<!--6C6BCBC5C75F449CAD5A8182866FF9D9-->  <AD_MESSAGE_ID><![CDATA[6C6BCBC5C75F449CAD5A8182866FF9D9]]></AD_MESSAGE_ID>
+<!--6C6BCBC5C75F449CAD5A8182866FF9D9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6C6BCBC5C75F449CAD5A8182866FF9D9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6C6BCBC5C75F449CAD5A8182866FF9D9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6C6BCBC5C75F449CAD5A8182866FF9D9-->  <VALUE><![CDATA[OBUIAPP_ClearSummaries]]></VALUE>
+<!--6C6BCBC5C75F449CAD5A8182866FF9D9-->  <MSGTEXT><![CDATA[Clear Summary Functions]]></MSGTEXT>
+<!--6C6BCBC5C75F449CAD5A8182866FF9D9-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--6C6BCBC5C75F449CAD5A8182866FF9D9-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--6C6BCBC5C75F449CAD5A8182866FF9D9--></AD_MESSAGE>
+
 <!--6CFA4900AECA4A45B35FEE55EBA14D01--><AD_MESSAGE>
 <!--6CFA4900AECA4A45B35FEE55EBA14D01-->  <AD_MESSAGE_ID><![CDATA[6CFA4900AECA4A45B35FEE55EBA14D01]]></AD_MESSAGE_ID>
 <!--6CFA4900AECA4A45B35FEE55EBA14D01-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -543,6 +642,17 @@
 <!--822D5C3E1A014738B4D39BF2BF568C7C-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--822D5C3E1A014738B4D39BF2BF568C7C--></AD_MESSAGE>
 
+<!--888D0AF770AE4037B85120FB775FE038--><AD_MESSAGE>
+<!--888D0AF770AE4037B85120FB775FE038-->  <AD_MESSAGE_ID><![CDATA[888D0AF770AE4037B85120FB775FE038]]></AD_MESSAGE_ID>
+<!--888D0AF770AE4037B85120FB775FE038-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--888D0AF770AE4037B85120FB775FE038-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--888D0AF770AE4037B85120FB775FE038-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--888D0AF770AE4037B85120FB775FE038-->  <VALUE><![CDATA[OBUIAPP_ClearSummaryFunction]]></VALUE>
+<!--888D0AF770AE4037B85120FB775FE038-->  <MSGTEXT><![CDATA[Remove Summary Function]]></MSGTEXT>
+<!--888D0AF770AE4037B85120FB775FE038-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--888D0AF770AE4037B85120FB775FE038-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--888D0AF770AE4037B85120FB775FE038--></AD_MESSAGE>
+
 <!--8A04AE875EC045B48038ADBCD2F66D8A--><AD_MESSAGE>
 <!--8A04AE875EC045B48038ADBCD2F66D8A-->  <AD_MESSAGE_ID><![CDATA[8A04AE875EC045B48038ADBCD2F66D8A]]></AD_MESSAGE_ID>
 <!--8A04AE875EC045B48038ADBCD2F66D8A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -576,6 +686,17 @@
 <!--90842C50FEE14D7FB3F24DDBC10CE9EC-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--90842C50FEE14D7FB3F24DDBC10CE9EC--></AD_MESSAGE>
 
+<!--927A12CB292E4551924935C9EA80B049--><AD_MESSAGE>
+<!--927A12CB292E4551924935C9EA80B049-->  <AD_MESSAGE_ID><![CDATA[927A12CB292E4551924935C9EA80B049]]></AD_MESSAGE_ID>
+<!--927A12CB292E4551924935C9EA80B049-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--927A12CB292E4551924935C9EA80B049-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--927A12CB292E4551924935C9EA80B049-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--927A12CB292E4551924935C9EA80B049-->  <VALUE><![CDATA[OBUIAPP_SummaryFunctionCount]]></VALUE>
+<!--927A12CB292E4551924935C9EA80B049-->  <MSGTEXT><![CDATA[Count]]></MSGTEXT>
+<!--927A12CB292E4551924935C9EA80B049-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--927A12CB292E4551924935C9EA80B049-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--927A12CB292E4551924935C9EA80B049--></AD_MESSAGE>
+
 <!--944AB9834FC24C30B89075D20B7FFE7F--><AD_MESSAGE>
 <!--944AB9834FC24C30B89075D20B7FFE7F-->  <AD_MESSAGE_ID><![CDATA[944AB9834FC24C30B89075D20B7FFE7F]]></AD_MESSAGE_ID>
 <!--944AB9834FC24C30B89075D20B7FFE7F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -709,6 +830,28 @@
 <!--B05C4EF1C8624EAAAC53764B7DACB2C2-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--B05C4EF1C8624EAAAC53764B7DACB2C2--></AD_MESSAGE>
 
+<!--B151C652F8204C8B896AB76BED5A273D--><AD_MESSAGE>
+<!--B151C652F8204C8B896AB76BED5A273D-->  <AD_MESSAGE_ID><![CDATA[B151C652F8204C8B896AB76BED5A273D]]></AD_MESSAGE_ID>
+<!--B151C652F8204C8B896AB76BED5A273D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B151C652F8204C8B896AB76BED5A273D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B151C652F8204C8B896AB76BED5A273D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B151C652F8204C8B896AB76BED5A273D-->  <VALUE><![CDATA[OBUIAPP_GroupBy10]]></VALUE>
+<!--B151C652F8204C8B896AB76BED5A273D-->  <MSGTEXT><![CDATA[By 10]]></MSGTEXT>
+<!--B151C652F8204C8B896AB76BED5A273D-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--B151C652F8204C8B896AB76BED5A273D-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--B151C652F8204C8B896AB76BED5A273D--></AD_MESSAGE>
+
+<!--B355D5A55A734B61B57A6AEBF3B96863--><AD_MESSAGE>
+<!--B355D5A55A734B61B57A6AEBF3B96863-->  <AD_MESSAGE_ID><![CDATA[B355D5A55A734B61B57A6AEBF3B96863]]></AD_MESSAGE_ID>
+<!--B355D5A55A734B61B57A6AEBF3B96863-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B355D5A55A734B61B57A6AEBF3B96863-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B355D5A55A734B61B57A6AEBF3B96863-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B355D5A55A734B61B57A6AEBF3B96863-->  <VALUE><![CDATA[OBUIAPP_GroupBy100000]]></VALUE>
+<!--B355D5A55A734B61B57A6AEBF3B96863-->  <MSGTEXT><![CDATA[By 100000]]></MSGTEXT>
+<!--B355D5A55A734B61B57A6AEBF3B96863-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--B355D5A55A734B61B57A6AEBF3B96863-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--B355D5A55A734B61B57A6AEBF3B96863--></AD_MESSAGE>
+
 <!--B5B5ECA6E070496D8A773F264B200208--><AD_MESSAGE>
 <!--B5B5ECA6E070496D8A773F264B200208-->  <AD_MESSAGE_ID><![CDATA[B5B5ECA6E070496D8A773F264B200208]]></AD_MESSAGE_ID>
 <!--B5B5ECA6E070496D8A773F264B200208-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -786,6 +929,28 @@
 <!--CA656863135B44B6BF645936B34C61C7-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--CA656863135B44B6BF645936B34C61C7--></AD_MESSAGE>
 
+<!--CB2FE513B6C0424A8D074AF6BDFC8607--><AD_MESSAGE>
+<!--CB2FE513B6C0424A8D074AF6BDFC8607-->  <AD_MESSAGE_ID><![CDATA[CB2FE513B6C0424A8D074AF6BDFC8607]]></AD_MESSAGE_ID>
+<!--CB2FE513B6C0424A8D074AF6BDFC8607-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CB2FE513B6C0424A8D074AF6BDFC8607-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CB2FE513B6C0424A8D074AF6BDFC8607-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CB2FE513B6C0424A8D074AF6BDFC8607-->  <VALUE><![CDATA[OBUIAPP_SummaryFunctionMin]]></VALUE>
+<!--CB2FE513B6C0424A8D074AF6BDFC8607-->  <MSGTEXT><![CDATA[Min]]></MSGTEXT>
+<!--CB2FE513B6C0424A8D074AF6BDFC8607-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--CB2FE513B6C0424A8D074AF6BDFC8607-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--CB2FE513B6C0424A8D074AF6BDFC8607--></AD_MESSAGE>
+
+<!--CB466C1E6F3A404387166106D9975BE9--><AD_MESSAGE>
+<!--CB466C1E6F3A404387166106D9975BE9-->  <AD_MESSAGE_ID><![CDATA[CB466C1E6F3A404387166106D9975BE9]]></AD_MESSAGE_ID>
+<!--CB466C1E6F3A404387166106D9975BE9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CB466C1E6F3A404387166106D9975BE9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CB466C1E6F3A404387166106D9975BE9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CB466C1E6F3A404387166106D9975BE9-->  <VALUE><![CDATA[OBUIAPP_GroupBy1000]]></VALUE>
+<!--CB466C1E6F3A404387166106D9975BE9-->  <MSGTEXT><![CDATA[By 1000]]></MSGTEXT>
+<!--CB466C1E6F3A404387166106D9975BE9-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--CB466C1E6F3A404387166106D9975BE9-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--CB466C1E6F3A404387166106D9975BE9--></AD_MESSAGE>
+
 <!--CBB8D95E3D4B471EBA06A7AD57065098--><AD_MESSAGE>
 <!--CBB8D95E3D4B471EBA06A7AD57065098-->  <AD_MESSAGE_ID><![CDATA[CBB8D95E3D4B471EBA06A7AD57065098]]></AD_MESSAGE_ID>
 <!--CBB8D95E3D4B471EBA06A7AD57065098-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -797,6 +962,17 @@
 <!--CBB8D95E3D4B471EBA06A7AD57065098-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--CBB8D95E3D4B471EBA06A7AD57065098--></AD_MESSAGE>
 
+<!--CE3E9A8711D54E719F02630BE8D5E2FB--><AD_MESSAGE>
+<!--CE3E9A8711D54E719F02630BE8D5E2FB-->  <AD_MESSAGE_ID><![CDATA[CE3E9A8711D54E719F02630BE8D5E2FB]]></AD_MESSAGE_ID>
+<!--CE3E9A8711D54E719F02630BE8D5E2FB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CE3E9A8711D54E719F02630BE8D5E2FB-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CE3E9A8711D54E719F02630BE8D5E2FB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CE3E9A8711D54E719F02630BE8D5E2FB-->  <VALUE><![CDATA[OBUIAPP_GroupBy1]]></VALUE>
+<!--CE3E9A8711D54E719F02630BE8D5E2FB-->  <MSGTEXT><![CDATA[By 1]]></MSGTEXT>
+<!--CE3E9A8711D54E719F02630BE8D5E2FB-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--CE3E9A8711D54E719F02630BE8D5E2FB-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--CE3E9A8711D54E719F02630BE8D5E2FB--></AD_MESSAGE>
+
 <!--D514BC49ED374B7288B215D94DAC3177--><AD_MESSAGE>
 <!--D514BC49ED374B7288B215D94DAC3177-->  <AD_MESSAGE_ID><![CDATA[D514BC49ED374B7288B215D94DAC3177]]></AD_MESSAGE_ID>
 <!--D514BC49ED374B7288B215D94DAC3177-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -808,6 +984,17 @@
 <!--D514BC49ED374B7288B215D94DAC3177-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--D514BC49ED374B7288B215D94DAC3177--></AD_MESSAGE>
 
+<!--DAC8C406FB1D497CAF91619E6B8A5458--><AD_MESSAGE>
+<!--DAC8C406FB1D497CAF91619E6B8A5458-->  <AD_MESSAGE_ID><![CDATA[DAC8C406FB1D497CAF91619E6B8A5458]]></AD_MESSAGE_ID>
+<!--DAC8C406FB1D497CAF91619E6B8A5458-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--DAC8C406FB1D497CAF91619E6B8A5458-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--DAC8C406FB1D497CAF91619E6B8A5458-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--DAC8C406FB1D497CAF91619E6B8A5458-->  <VALUE><![CDATA[OBUIAPP_GroupBy]]></VALUE>
+<!--DAC8C406FB1D497CAF91619E6B8A5458-->  <MSGTEXT><![CDATA[Group by ${title}]]></MSGTEXT>
+<!--DAC8C406FB1D497CAF91619E6B8A5458-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--DAC8C406FB1D497CAF91619E6B8A5458-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--DAC8C406FB1D497CAF91619E6B8A5458--></AD_MESSAGE>
+
 <!--DDD348E58C614475B5207B2A5576F2FD--><AD_MESSAGE>
 <!--DDD348E58C614475B5207B2A5576F2FD-->  <AD_MESSAGE_ID><![CDATA[DDD348E58C614475B5207B2A5576F2FD]]></AD_MESSAGE_ID>
 <!--DDD348E58C614475B5207B2A5576F2FD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -929,6 +1116,17 @@
 <!--EE57AA334D6846718FBA9E042EA4F5EF-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--EE57AA334D6846718FBA9E042EA4F5EF--></AD_MESSAGE>
 
+<!--EE6743B612B74EF5A934923ED8405B07--><AD_MESSAGE>
+<!--EE6743B612B74EF5A934923ED8405B07-->  <AD_MESSAGE_ID><![CDATA[EE6743B612B74EF5A934923ED8405B07]]></AD_MESSAGE_ID>
+<!--EE6743B612B74EF5A934923ED8405B07-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--EE6743B612B74EF5A934923ED8405B07-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--EE6743B612B74EF5A934923ED8405B07-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--EE6743B612B74EF5A934923ED8405B07-->  <VALUE><![CDATA[OBUIAPP_SummaryFunctionSum]]></VALUE>
+<!--EE6743B612B74EF5A934923ED8405B07-->  <MSGTEXT><![CDATA[Sum]]></MSGTEXT>
+<!--EE6743B612B74EF5A934923ED8405B07-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--EE6743B612B74EF5A934923ED8405B07-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--EE6743B612B74EF5A934923ED8405B07--></AD_MESSAGE>
+
 <!--EE927849CF7D4247B9E8907A91DA2A79--><AD_MESSAGE>
 <!--EE927849CF7D4247B9E8907A91DA2A79-->  <AD_MESSAGE_ID><![CDATA[EE927849CF7D4247B9E8907A91DA2A79]]></AD_MESSAGE_ID>
 <!--EE927849CF7D4247B9E8907A91DA2A79-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -973,6 +1171,17 @@
 <!--FBA2F11416C4413F8E2D554119461964-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--FBA2F11416C4413F8E2D554119461964--></AD_MESSAGE>
 
+<!--FF1B52D0AF694B0EB3F220D65E3BD28F--><AD_MESSAGE>
+<!--FF1B52D0AF694B0EB3F220D65E3BD28F-->  <AD_MESSAGE_ID><![CDATA[FF1B52D0AF694B0EB3F220D65E3BD28F]]></AD_MESSAGE_ID>
+<!--FF1B52D0AF694B0EB3F220D65E3BD28F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF1B52D0AF694B0EB3F220D65E3BD28F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF1B52D0AF694B0EB3F220D65E3BD28F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF1B52D0AF694B0EB3F220D65E3BD28F-->  <VALUE><![CDATA[OBUIAPP_GroupBy100]]></VALUE>
+<!--FF1B52D0AF694B0EB3F220D65E3BD28F-->  <MSGTEXT><![CDATA[By 100]]></MSGTEXT>
+<!--FF1B52D0AF694B0EB3F220D65E3BD28F-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--FF1B52D0AF694B0EB3F220D65E3BD28F-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--FF1B52D0AF694B0EB3F220D65E3BD28F--></AD_MESSAGE>
+
 <!--FF8080812DDB247F012DDB685F940080--><AD_MESSAGE>
 <!--FF8080812DDB247F012DDB685F940080-->  <AD_MESSAGE_ID><![CDATA[FF8080812DDB247F012DDB685F940080]]></AD_MESSAGE_ID>
 <!--FF8080812DDB247F012DDB685F940080-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 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.18210]]></VERSION>
+<!--9BA0836A3CD74EE4AB48753A47211BCC-->  <VERSION><![CDATA[2.1.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 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.18210]]></STARTVERSION>
+<!--15D7CE8D95D043189162DBABA54A1F61-->  <STARTVERSION><![CDATA[2.1.18279]]></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.18210]]></STARTVERSION>
+<!--60A170212F36499D83B8AD38D01F46B3-->  <STARTVERSION><![CDATA[2.1.18279]]></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.18210]]></STARTVERSION>
+<!--824D60CB352E4099B1D8C903CA139DAE-->  <STARTVERSION><![CDATA[3.0.18279]]></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.18210]]></STARTVERSION>
+<!--E8FD820AFE3D4FE08C02FC47769026AD-->  <STARTVERSION><![CDATA[8.1.18279]]></STARTVERSION>
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <DEPENDANT_MODULE_NAME><![CDATA[Smartclient]]></DEPENDANT_MODULE_NAME>
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_REF_LIST.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_REF_LIST.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -128,6 +128,18 @@
 <!--BF6EAC4255D0484399EF03DB23376CD4-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--BF6EAC4255D0484399EF03DB23376CD4--></AD_REF_LIST>
 
+<!--C305601E197949A5A07257C701CFA04C--><AD_REF_LIST>
+<!--C305601E197949A5A07257C701CFA04C-->  <AD_REF_LIST_ID><![CDATA[C305601E197949A5A07257C701CFA04C]]></AD_REF_LIST_ID>
+<!--C305601E197949A5A07257C701CFA04C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C305601E197949A5A07257C701CFA04C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C305601E197949A5A07257C701CFA04C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C305601E197949A5A07257C701CFA04C-->  <VALUE><![CDATA[OBUIAPP_GroupingEnabled]]></VALUE>
+<!--C305601E197949A5A07257C701CFA04C-->  <NAME><![CDATA[Grouping Enabled]]></NAME>
+<!--C305601E197949A5A07257C701CFA04C-->  <DESCRIPTION><![CDATA[Defines if grouping should be enabled for a window]]></DESCRIPTION>
+<!--C305601E197949A5A07257C701CFA04C-->  <AD_REFERENCE_ID><![CDATA[A26BA480E2014707B47257024C3CBFF7]]></AD_REFERENCE_ID>
+<!--C305601E197949A5A07257C701CFA04C-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--C305601E197949A5A07257C701CFA04C--></AD_REF_LIST>
+
 <!--C38DEECEC59544609E4CC4D7FC819E46--><AD_REF_LIST>
 <!--C38DEECEC59544609E4CC4D7FC819E46-->  <AD_REF_LIST_ID><![CDATA[C38DEECEC59544609E4CC4D7FC819E46]]></AD_REF_LIST_ID>
 <!--C38DEECEC59544609E4CC4D7FC819E46-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -140,6 +152,18 @@
 <!--C38DEECEC59544609E4CC4D7FC819E46-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--C38DEECEC59544609E4CC4D7FC819E46--></AD_REF_LIST>
 
+<!--F45C2509CCF14629906DE44B542D903F--><AD_REF_LIST>
+<!--F45C2509CCF14629906DE44B542D903F-->  <AD_REF_LIST_ID><![CDATA[F45C2509CCF14629906DE44B542D903F]]></AD_REF_LIST_ID>
+<!--F45C2509CCF14629906DE44B542D903F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F45C2509CCF14629906DE44B542D903F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F45C2509CCF14629906DE44B542D903F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F45C2509CCF14629906DE44B542D903F-->  <VALUE><![CDATA[OBUIAPP_GroupingMaxRecords]]></VALUE>
+<!--F45C2509CCF14629906DE44B542D903F-->  <NAME><![CDATA[Maximum Number of Records for Grouping]]></NAME>
+<!--F45C2509CCF14629906DE44B542D903F-->  <DESCRIPTION><![CDATA[Maximum number of records for grouping to be enabled.]]></DESCRIPTION>
+<!--F45C2509CCF14629906DE44B542D903F-->  <AD_REFERENCE_ID><![CDATA[A26BA480E2014707B47257024C3CBFF7]]></AD_REFERENCE_ID>
+<!--F45C2509CCF14629906DE44B542D903F-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--F45C2509CCF14629906DE44B542D903F--></AD_REF_LIST>
+
 <!--FF8080812DE1CD58012DE1FC1FB9002F--><AD_REF_LIST>
 <!--FF8080812DE1CD58012DE1FC1FB9002F-->  <AD_REF_LIST_ID><![CDATA[FF8080812DE1CD58012DE1FC1FB9002F]]></AD_REF_LIST_ID>
 <!--FF8080812DE1CD58012DE1FC1FB9002F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/MenuManager.java	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/MenuManager.java	Mon Oct 29 09:55:52 2012 +0100
@@ -441,6 +441,14 @@
       return Boolean.toString(isReadOnly());
     }
 
+    public boolean isEditOrDeleteOnly() {
+      return getTab() != null && getTab().getUIPattern().equals("ED");
+    }
+
+    public String getEditOrDeleteOnlyStringValue() {
+      return Boolean.toString(isEditOrDeleteOnly());
+    }
+
     public boolean isReport() {
       return isReport;
     }
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/QuickCreateDataSource.java	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/QuickCreateDataSource.java	Mon Oct 29 09:55:52 2012 +0100
@@ -91,7 +91,8 @@
         final Map<String, Object> data = new HashMap<String, Object>();
 
         // read only tab
-        if (menuOption.isSingleRecord() || menuOption.isReadOnly()) {
+        if (menuOption.isSingleRecord() || menuOption.isReadOnly()
+            || menuOption.isEditOrDeleteOnly()) {
           continue;
         }
 
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/QuickLaunchDataSource.java	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/QuickLaunchDataSource.java	Mon Oct 29 09:55:52 2012 +0100
@@ -47,6 +47,7 @@
   public static final String OPTION_TYPE_TAB = "tab";
   public static final String OPTION_SINGLE_RECORD = "singleRecord";
   public static final String OPTION_READ_ONLY = "readOnly";
+  public static final String OPTION_EDIT_OR_DELETE_ONLY = "editOrDeleteOnly";
   public static final String PROCESS_ID = "processId";
   public static final String WINDOW_ID = "windowId";
   public static final String FORM_ID = "formId";
@@ -105,6 +106,7 @@
           data.put(WINDOW_ID, menuOption.getMenu().getWindow().getId());
           data.put(OPTION_SINGLE_RECORD, menuOption.isSingleRecord());
           data.put(OPTION_READ_ONLY, menuOption.isReadOnly());
+          data.put(OPTION_EDIT_OR_DELETE_ONLY, menuOption.isEditOrDeleteOnly());
         } else if (menuOption.isProcess()) {
           data.put(OPTION_TYPE, "process");
           data.put(PROCESS_ID, menuOption.getMenu().getProcess().getId());
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/templates/application-menu.js.ftl	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/templates/application-menu.js.ftl	Mon Oct 29 09:55:52 2012 +0100
@@ -63,6 +63,7 @@
     </#if>
     , singleRecord: ${menuOption.singleRecordStringValue}
     , readOnly: ${menuOption.readOnlyStringValue}
+    , editOrDeleteOnly: ${menuOption.editOrDeleteOnlyStringValue}
     
     <#list menuOption.parameters as parameter>
         , '${parameter.name?js_string}': '${parameter.parameterValue?js_string}'        
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-field.js.ftl	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-field.js.ftl	Mon Oct 29 09:55:52 2012 +0100
@@ -108,6 +108,7 @@
         </#if>
         <#if field.showSummary>
             showGridSummary: true,
+            showGroupSummary: true,
             <#if field.summaryFunction != "">
               summaryFunction: ${field.summaryFunction},
             <#else>
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewFieldHandler.java	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewFieldHandler.java	Mon Oct 29 09:55:52 2012 +0100
@@ -19,6 +19,7 @@
 package org.openbravo.client.application.window;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
@@ -58,6 +59,9 @@
 
   private String parentProperty;
 
+  private static List<String> STANDARD_SUMMARY_FN = Arrays.asList("sum", "avg", "max", "min",
+      "multiplier", "count", "title");
+
   private static final long ONE_COLUMN_MAX_LENGTH = 60;
   private static final String TEXT_AD_REFERENCE_ID = "14";
   private static final String IMAGEBLOB_AD_REFERENCE_ID = "4AA6C3BE9D3B4D84A3B80489505A23E5";
@@ -1336,18 +1340,29 @@
     }
 
     public boolean isShowSummary() {
-      if (field.isOBUIAPPShowSummary() != null) {
-        return field.isOBUIAPPShowSummary();
+      if (field.isOBUIAPPShowSummary() != null || field.getObuiappSummaryfn() != null) {
+        return field.getObuiappSummaryfn() != null || field.isOBUIAPPShowSummary();
       }
       return false;
     }
 
     public String getSummaryFunction() {
       if (field.getObuiappSummaryfn() != null) {
-        return field.getObuiappSummaryfn();
+        return addQuotesToStandardSummaryFunctions(field.getObuiappSummaryfn());
       }
       return "";
     }
+
+    private String addQuotesToStandardSummaryFunctions(String value) {
+      String localValue = value.trim();
+      if (localValue.startsWith("'") || localValue.startsWith("\"")) {
+        return value;
+      }
+      if (STANDARD_SUMMARY_FN.contains(localValue)) {
+        return "'" + localValue + "'";
+      }
+      return value;
+    }
   }
 
   public class DefaultVirtualField implements OBViewFieldDefinition {
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk-filter.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk-filter.js	Mon Oct 29 09:55:52 2012 +0100
@@ -19,13 +19,269 @@
 
 //== OBFKFilterTextItem ==
 //Input used for filtering on FK fields.
-isc.ClassFactory.defineClass('OBFKFilterTextItem', isc.TextItem);
+isc.ClassFactory.defineClass('OBFKFilterTextItem', isc.OBListFilterItem);
 
 isc.OBFKFilterTextItem.addProperties({
   operator: 'iContains',
-  allowExpressions: true,
-  validateOnExit: false,
-  validateOnChange: false,
+  overrideTextMatchStyle: 'substring',
+  allowExpressions: false,
+  showOptionsFromDataSource: true,
+  selectOnFocus: false,
+  validateOnExit: true,
+
+  multiple: true,
+  multipleAppearance: 'picklist',
+  multipleValueSeparator: ' or ',
+
+  // only show the drop down on demand
+  // this because we want to support partial values
+  // for filtering, also getting trouble because values get
+  // completely selected
+  showPickListOnKeypress: true,
+  filterOnKeypress: false,
+  changeOnKeypress: true,
+  addUnknownValues: true,
+  defaultToFirstOption: false,
+
+  emptyPickListMessage: OB.I18N.getLabel('OBUISC_ListGrid.emptyMessage'),
+
+  init: function () {
+    var me = this,
+        grid = this.form.grid.sourceWidget,
+        gridField = grid.getField(this.name);
+
+    // the textMatchStyle is sometimes overridden from the underlying
+    // grid, this happens when used within the selector editor.
+    // for foreign key fields we only support like/contains/substring
+    // so force that
+    this.textMatchStyle = this.overrideTextMatchStyle;
+
+    // the data from the datasource will contain the id and the identifier
+    // the value for the filter and the display are the same: the identifier
+    this.displayField = OB.Constants.IDENTIFIER;
+    this.valueField = OB.Constants.IDENTIFIER;
+
+    this.pickListProperties = {
+
+      // make sure that we send the same parameters as the grid
+      onFetchData: function (criteria, requestProperties) {
+        requestProperties = requestProperties || {};
+        requestProperties.params = grid.getFetchRequestParams(requestProperties.params);
+        delete me.forceReload;
+      },
+
+      fetchDelay: 400,
+      // prevent aggressive local filtering by smartclient
+      filterLocally: false,
+      multipleValueSeparator: ' or ',
+      dataProperties: {
+        useClientFiltering: false
+      },
+
+      isSelected: function (record) {
+        var i, values = this.formItem.getValue();
+        if (values.length) {
+          for (i = 0; i < values.length; i++) {
+            if (record[OB.Constants.IDENTIFIER] === values[i]) {
+              return true;
+            }
+          }
+        }
+        return record[OB.Constants.IDENTIFIER] === values;
+      },
+
+      // override data arrived to prevent the first entry from being
+      // selected
+      // this to handle the picklist in foreign key filter item. When a user
+      // types a partial value maybe he/she wants to filter by this partial
+      // value
+      // auto-selecting the first value makes this impossible.
+      // Therefore this option to prevent this.
+      // There are maybe nicer points to do this overriding but this was the
+      // place after the first item was selected.
+      // This first selection happens in ScrollingMenu.dataChanged
+      dataArrived: function (startRow, endRow) {
+        var record, rowNum, i, values = this.formItem.getValue();
+        this.Super('dataArrived', arguments);
+        if (values) {
+          if (!isc.isA.Array(values)) {
+            values = [values];
+          }
+          for (rowNum = startRow; rowNum < (endRow + 1); rowNum++) {
+            record = this.getRecord(rowNum);
+            if (record && values.contains(record[OB.Constants.IDENTIFIER])) {
+              this.selectRecord(record, true);
+            }
+          }
+        }
+      }
+    };
+
+    this.setOptionDataSource(OB.Datasource.create({
+      dataURL: grid.getDataSource().dataURL,
+      requestProperties: {
+        params: {
+          // distinct forces the distinct query on the server side
+          _distinct: gridField.valueField || gridField.name,
+          // identifier is not listed here as it is always send, actually
+          // the id is also always send, but setting _selectedProperties
+          // prevents other fields from coming over
+          _selectedProperties: 'id'
+        }
+      },
+      fields: this.pickListFields
+    }));
+
+    this.Super('init', arguments);
+
+    // listen to data arrival in the grid
+    // if data arrived we have to reload also
+    this.observe(grid, "dataArrived", "observer.setForceReload()");
+
+    this.multipleValueSeparator = ' or ';
+  },
+
+  // 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 () {
+    return [{
+      name: this.displayField
+    }];
+  },
+
+  itemHoverHTML: function () {
+    return this.getDisplayValue();
+  },
+
+  mapValueToDisplay: function (value) {
+    var i, result = '';
+    if (!isc.isAn.Array(value)) {
+      return this.Super('mapValueToDisplay', arguments);
+    }
+    for (i = 0; i < value.length; i++) {
+      if (i > 0) {
+        result += this.multipleValueSeparator;
+      }
+      // encode or and and
+      result += OB.Utilities.encodeSearchOperator(this.Super('mapValueToDisplay', value[i]));
+    }
+    return result;
+  },
+
+  // combine the value of the field with the overall grid
+  // filter values
+  getPickListFilterCriteria: function () {
+    var pickListCriteria = this.getCriterion(),
+        gridCriteria = this.form.grid.sourceWidget.getCriteria(),
+        i, criteriaFieldName = this.getCriteriaFieldName();
+
+    gridCriteria = gridCriteria || {
+      _constructor: 'AdvandedCriteria',
+      operator: 'and'
+    };
+    gridCriteria.criteria = gridCriteria.criteria || [];
+
+    for (i = 0; i < gridCriteria.criteria.length; i++) {
+      if (criteriaFieldName === gridCriteria.criteria[i].fieldName) {
+        gridCriteria.criteria.removeAt(i);
+        break;
+      }
+    }
+
+    // when in refresh picklist the user is typing
+    // a value, filter using that
+    if (this.keyPressed && pickListCriteria) {
+      gridCriteria.criteria.add(pickListCriteria);
+      delete this.keyPressed;
+    }
+
+    // add a dummy criteria to force a fetch
+    // smartclient will try to do smart and prevent fetches if
+    // criteria have not changed
+    // note the system can be made smarter by checking if something
+    // got reloaded in the underlying grid
+    if (this.forceReload) {
+      gridCriteria.criteria.push(isc.OBRestDataSource.getDummyCriterion());
+    }
+    return gridCriteria;
+  },
+
+  setForceReload: function () {
+    this.forceReload = true;
+    if (this.form) {
+      this.invalidateDisplayValueCache();
+    }
+  },
+
+  canEditCriterion: function (criterion) {
+    return criterion && criterion.fieldName === this.name;
+  },
+
+  getCriterion: function (textMatchStyle) {
+    var value = this.getCriteriaValue(),
+        operator, fieldName, crit;
+
+    if (value === null || isc.is.emptyString(value)) {
+      return;
+    }
+
+    // the criteria parser expects an or expression
+    if (isc.isAn.Array(value)) {
+      value = this.mapValueToDisplay(value);
+    }
+
+    operator = this.getOperator(textMatchStyle, isc.isAn.Array(value));
+    fieldName = this.getCriteriaFieldName();
+
+    crit = this.parseValueExpressions(value, fieldName, operator);
+    if (crit !== null) {
+      return crit;
+    }
+
+    return {
+      fieldName: fieldName,
+      operator: operator,
+      value: value
+    };
+  },
+
+  setCriterion: function (criterion) {
+    var i, value, values = [],
+        criteria = criterion ? criterion.criteria : null;
+    if (criteria && criteria.length && criterion.operator === 'or') {
+      for (i = 0; i < criteria.length; i++) {
+        values.push(criteria[i].value);
+      }
+      this.setValue(values);
+    } else {
+      value = this.buildValueExpressions(criterion);
+      this.setValue(value);
+    }
+  },
+
+  // make sure that the correct field name is used to filter the main grid
+  // if this is not here then the value will be removed by smartclient as it
+  // sets the criterion back into the item
+  // see also the setValuesAsCriteria in ob-grid-js which again translates
+  // back
+  getCriteriaFieldName: function () {
+    return this.name + OB.Constants.FIELDSEPARATOR + OB.Constants.IDENTIFIER;
+  },
 
   // solve a small bug in the value expressions
   buildValueExpressions: function () {
@@ -34,5 +290,51 @@
       return ret.replace('undefined', '');
     }
     return ret;
+  },
+
+  refreshPickList: function () {
+    if (this.valueIsExpression()) {
+      return;
+    }
+
+    // is called when the user enters values
+    // filter using those values
+    if (!this._pickedValue) {
+      this.keyPressed = true;
+    }
+
+    return this.Super('refreshPickList', arguments);
+  },
+
+  valueIsExpression: function () {
+    var prop, opDefs, val = this.getDisplayValue();
+    // if someone starts typing and and or then do not filter
+    // onkeypress either
+    if (val.contains(' and')) {
+      return true;
+    }
+
+    if (val.startsWith('=')) {
+      return true;
+    }
+
+    // now check if the item element value is only
+    // an operator, if so, go away
+    opDefs = isc.DataSource.getSearchOperators();
+    for (prop in opDefs) {
+      if (opDefs.hasOwnProperty(prop)) {
+        // let null and not null fall through
+        // as they should be filtered
+        if (prop === 'isNull' || prop === 'notNull') {
+          continue;
+        }
+
+        same = opDefs[prop].symbol && val.startsWith(opDefs[prop].symbol);
+        if (same) {
+          return true;
+        }
+      }
+    }
+    return false;
   }
 });
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list-filter.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list-filter.js	Mon Oct 29 09:55:52 2012 +0100
@@ -27,24 +27,31 @@
   operator: 'equals',
   validateOnExit: false,
   validateOnChange: false,
-  filterOnKeypress: false,
+  filterOnKeypress: true,
   addUnknownValues: false,
 
-  init: function () {
-    if (this.valueMap) {
-      // add the empty value in this way to make sure that the 
-      // space is shown first
-      this.valueMap = isc.addProperties({
-        '': ''
-      }, this.valueMap);
-    }
-    this.Super('init', arguments);
+  defaultToFirstOption: false,
+
+  multiple: true,
+  multipleAppearance: 'picklist',
+  multipleValueSeparator: ' or ',
+
+  // remove the width so that smartclient will autoflow the content
+  // will make sure that the picklist is resized.
+  // http://forums.smartclient.com/showthread.php?p=93868#post93868
+  getPickListFields: function () {
+    var ret = this.Super('getPickListFields', arguments);
+    delete ret[0].width;
+    return ret;
   },
 
-  setValueMap: function (valueMap) {
-    this.Super('setValueMap', [isc.addProperties({
-      '': ''
-    }, valueMap)]);
+  // overridden to prevent selection of first item
+  selectDefaultItem: function () {},
+
+  showPickList: function () {
+    var ret = this.Super('showPickList', arguments);
+
+    this.selectItemFromValue(this.getValue());
   },
 
   // note: can't override changed as it is used by the filter editor 
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list.js	Mon Oct 29 09:55:52 2012 +0100
@@ -36,6 +36,10 @@
   // textMatchStyle is used for the client-side picklist
   textMatchStyle: 'substring',
 
+  pickListProperties: {
+    showHeaderContextMenu: false
+  },
+
   // NOTE: Setting this property to false fixes the issue when using the mouse
   // to pick a value
   // FIXME: Sometimes the field label gets a red color (a blink)
@@ -94,10 +98,6 @@
     }
   },
 
-  pickListProperties: {
-    showHeaderContextMenu: false
-  },
-
   // to solve: https://issues.openbravo.com/view.php?id=17800
   // in chrome the order of the valueMap object is not retained
   // the solution is to keep a separate entries array with the
@@ -145,10 +145,29 @@
 
   // prevent ids from showing up
   mapValueToDisplay: function (value) {
-    var ret = this.Super('mapValueToDisplay', arguments);
-    if (this.valueMap && this.valueMap[value]) {
-      this.lastSelectedValue = value;
-      return this.valueMap[value];
+    var i, ret = this.Super('mapValueToDisplay', arguments),
+        result;
+
+    // the datasource should handle it
+    if (this.optionDataSource) {
+      return ret;
+    }
+
+    if (this.valueMap) {
+      // handle multi-select
+      if (isc.isA.Array(value)) {
+        this.lastSelectedValue = value;
+        for (i = 0; i < value.length; i++) {
+          if (i > 0) {
+            result += this.multipleValueSeparator;
+          }
+          // encode or and and
+          result += OB.Utilities.encodeSearchOperator(this.Super('mapValueToDisplay', value[i]));
+        }
+      } else if (this.valueMap[value]) {
+        this.lastSelectedValue = value;
+        return this.valueMap[value];
+      }
     }
 
     if (ret === value && this.isDisabled()) {
@@ -168,7 +187,24 @@
     return ret;
   },
 
+  isUnknownValue: function (value) {
+    var i, array;
+    if (!value || !this.multiple || !value.contains(this.multipleValueSeparator)) {
+      return this.Super('isUnknownValue', arguments);
+    }
+    // handle multi-select
+    array = value.split(this.multipleValueSeparator);
+    for (i = 0; i < array.length; i++) {
+      if (this.isUnknownValue(array[i])) {
+        return true;
+      }
+    }
+    return false;
+  },
+
   mapDisplayToValue: function (display) {
+    var i, array, result;
+
     if (display === '') {
       return null;
     }
@@ -177,8 +213,15 @@
       // entries in the valuemap with the same value
       // See issue https://issues.openbravo.com/view.php?id=21553
       return this.lastSelectedValue;
+    } else if (!display || !this.multiple || !display.contains(this.multipleValueSeparator)) {
+      return this.Super('mapDisplayToValue', arguments);
     } else {
-      return this.Super('mapDisplayToValue', arguments);
+      array = display.split(this.multipleValueSeparator);
+      result = [];
+      for (i = 0; i < array.length; i++) {
+        result.add(this.Super('mapDisplayToValue', [array[i]]));
+      }
+      return result;
     }
   }
 
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js	Mon Oct 29 09:55:52 2012 +0100
@@ -224,7 +224,7 @@
    * Opens linked item in a new window
    */
   openLinkedItemInNewWindow: function (record) {
-    OB.Utilities.openView(record.adWindowId, record.adTabId, record.adMenuName, record.id, 'DIRECT', null, record.readOnly, record.singleRecord, true);
+    OB.Utilities.openView(record.adWindowId, record.adTabId, record.adMenuName, record.id, 'DIRECT', null, record.readOnly, record.singleRecord, true, record.editOrDeleteOnly);
   },
 
   /**
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Mon Oct 29 09:55:52 2012 +0100
@@ -1437,7 +1437,7 @@
       if (status === isc.RPCResponse.STATUS_SUCCESS && recordIndex === -1) {
         var visibleRows = view.viewGrid.body.getVisibleRows();
         if (visibleRows[0] !== -1) {
-          view.viewGrid.data.insertCacheData(data, visibleRows[0]);
+          view.viewGrid.addToCacheData(data, visibleRows[0]);
           recordIndex = visibleRows[0];
         }
       }
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js	Mon Oct 29 09:55:52 2012 +0100
@@ -376,7 +376,7 @@
     // prevent this as we get the datasource later it is not 
     // yet set
     getEditorProperties: function (field) {
-      var noDataSource = field.displayField && !field.optionDataSource,
+      var noDataSource = !field.optionDataSource,
           ret = this.Super('getEditorProperties', arguments);
       if (ret.optionDataSource && noDataSource) {
         delete ret.optionDataSource;
@@ -719,10 +719,8 @@
 isc.OBGridSummary.addProperties({
   getCellStyle: function (record, rowNum, colNum) {
     var field = this.getField(colNum);
-    if (field.summaryFunction === 'sum' && this.summaryRowStyle_sum) {
-      return this.summaryRowStyle_sum;
-    } else if (field.summaryFunction === 'avg' && this.summaryRowStyle_avg) {
-      return this.summaryRowStyle_avg;
+    if (field.summaryFunction && this['summaryRowStyle_' + field.summaryFunction]) {
+      return this['summaryRowStyle_' + field.summaryFunction];
     } else {
       return this.summaryRowStyle;
     }
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Mon Oct 29 09:55:52 2012 +0100
@@ -35,7 +35,10 @@
     CANCEL: 4,
     SEPARATOR2: 5,
     SAVE: 6
-  }
+  },
+
+  SUPPORTED_SUMMARY_FUNCTIONS: ['count', 'avg', 'min', 'max', 'sum']
+
 });
 
 if (!isc.Browser.isIE) {
@@ -73,7 +76,7 @@
     canHide: false,
     showTitle: true,
     title: '&nbsp;',
-    //autoFitWidth: true,
+    // autoFitWidth: true,
     canDragResize: false,
     canFilter: true,
     autoExpand: false,
@@ -105,7 +108,12 @@
   canFreezeFields: true,
   canAddFormulaFields: true,
   canAddSummaryFields: true,
-  canGroupBy: false,
+
+  canGroupBy: true,
+  showGroupSummaryInHeader: true,
+  showGroupSummary: true,
+  showGroupTitleColumn: false,
+  groupByMaxRecords: 1000,
   selectionAppearance: 'checkbox',
   arrowKeyAction: 'select',
   useAllDataSourceFields: false,
@@ -114,6 +122,8 @@
   canOpenRecordEditor: true,
   showDetailFields: true,
   showErrorIcons: false,
+  ungroupText: OB.I18N.getLabel('OBUIAPP_ungroup'),
+  groupByText: OB.I18N.getLabel('OBUIAPP_GroupBy'),
 
   allowFilterExpressions: true,
   showFilterExpressionLegendMenuItem: true,
@@ -138,11 +148,11 @@
 
   // commented out because of: https://issues.openbravo.com/view.php?id=16515
   // default is much smaller which give smoother scrolling
-  //  quickDrawAheadRatio: 1.0,
-  //drawAheadRatio: 2.0,
+  // quickDrawAheadRatio: 1.0,
+  // drawAheadRatio: 2.0,
   // see this discussion:
   // http://forums.smartclient.com/showthread.php?t=16376
-  //scrollRedrawDelay: 20,
+  // scrollRedrawDelay: 20,
   // note: don't set drawAllMaxCells too high as it results in extra reads
   // of data, Smartclient will try to read until drawAllMaxCells has been
   // reached
@@ -176,22 +186,24 @@
   // the smartclient forum:
   // http://forums.smartclient.com/showthread.php?p=63146
   showAllColumns: true,
-  //showGridSummary: true,
+  // showGridSummary: true,
   timeFormatter: 'to24HourTime',
 
   dataProperties: {
-    // this means that after an update/add the new/updated row does not fit 
+    // this means that after an update/add the new/updated row does not fit
     // in the current filter criteria then they are still shown
     // note that if this is set to false that when using the _dummy criteria
-    // that the _dummy criteria can mean that new/updated records are not 
+    // that the _dummy criteria can mean that new/updated records are not
     // shown in the grid
     neverDropUpdatedRows: true,
     useClientFiltering: false,
     useClientSorting: false,
+    fetchDelay: 300,
 
     // overridden to update the context/request properties for the fetch
     fetchRemoteData: function (serverCriteria, startRow, endRow) {
-      var requestProperties = this.context;
+      // clone to prevent side effects
+      var requestProperties = isc.clone(this.context);
       this.grid.getFetchRequestParams(requestProperties.params);
 
       return this.Super('fetchRemoteData', arguments);
@@ -218,7 +230,7 @@
         }
       }
       // only do this stuff for fetch operations, in other cases strange things
-      // happen as update/delete operations do not return the totalRows parameter      
+      // happen as update/delete operations do not return the totalRows parameter
       if (dsResponse && dsResponse.context && dsResponse.context.operationType !== 'fetch') {
         return newData;
       }
@@ -233,9 +245,9 @@
           }
         }
 
-        // get rid of old loading markers, this has to be done explicitly 
+        // get rid of old loading markers, this has to be done explicitly
         // as we can return another rowset than requested
-        // call with a delay otherwise the grid will keep requesting rows while processing the 
+        // call with a delay otherwise the grid will keep requesting rows while processing the
         // current rowset
         this.delayCall('clearLoadingMarkers', [dsResponse.context.startRow, dsResponse.context.endRow], 100);
       }
@@ -249,11 +261,81 @@
   initWidget: function () {
     var i, vwState;
 
-    // make a copy of the dataProperties otherwise we get 
+    // make a copy of the dataProperties otherwise we get
     // change results that values of one grid are copied/coming back
     // in other grids
     this.dataProperties = isc.addProperties({}, this.dataProperties);
 
+    // override setSort to sort by group title when the grouped by 
+    // column is clicked
+    this.groupTreeProperties = {
+      grid: this,
+
+      // always return all records
+      getRange: function (start, end) {
+        return this.getOpenList(
+        this.root, this.openDisplayNodeType, null, this.sortDirection, this.openListCriteria, null, true).slice(start, end);
+      },
+
+      setSort: function (sortSpecifier) {
+        var i, fld, sortSpec = isc.clone(sortSpecifier),
+            flds = this.grid.getAllFields(),
+            groupByFields = this.grid.getGroupByFields();
+
+        if (groupByFields && sortSpec && sortSpec[0]) {
+          for (i = 0; i < flds.length; i++) {
+            fld = flds[i];
+            if (groupByFields.contains(fld.name) && (fld.name === sortSpec[0].property || fld.displayField === sortSpec[0].property)) {
+              sortSpec[0].property = 'groupValue';
+              break;
+            }
+          }
+        }
+
+        return this.Super('setSort', [sortSpec]);
+      }
+    };
+
+    // re-use getCellValue to handle count and related functions
+    this.summaryRowProperties = {
+      cellHoverHTML: this.cellHoverHTML,
+
+      getCellAlign: function (record, rowNum, colNum) {
+        var fld = this.getFields()[colNum],
+            isRTL = this.isRTL(),
+            func = this.getGridSummaryFunction(fld),
+            isSummary = record && (record[this.groupSummaryRecordProperty] || record[this.gridSummaryRecordProperty]);
+
+        // the count of a character column should also be right aligned
+        if (isSummary && func === 'count') {
+          return isRTL ? isc.Canvas.LEFT : isc.Canvas.RIGHT;
+        }
+
+        return this.Super('getCellAlign', arguments);
+      },
+
+      // only set active view but don't do any context menu
+      cellContextClick: function () {
+        this.view.setAsActiveView();
+        return false;
+      },
+
+      view: this.view,
+
+      getCellValue: function (record, recordNum, fieldNum, gridBody) {
+        var field = this.getField(fieldNum),
+            func = this.getGridSummaryFunction(field),
+            value = record && field ? (field.displayField ? record[field.displayField] : record[field.name]) : null;
+        // handle count much simpler than smartclient does
+        // so no extra titles or formatting
+        if (record && func === 'count' && value >= 0) {
+          return value;
+        }
+
+        return this.Super('getCellValue', arguments);
+      }
+    };
+
     var thisGrid = this,
         localEditLinkField;
     if (this.editGrid) {
@@ -302,7 +384,7 @@
 
     // TODO: add dynamic part of readonly (via setWindowSettings: see issue 17441)
     // add context-menu only if 'new' is allowed in tab definition
-    if (this.uiPattern !== 'SR' && this.uiPattern !== 'RO') {
+    if (this.uiPattern !== 'SR' && this.uiPattern !== 'RO' && this.uiPattern !== 'ED') {
       this.contextMenu = this.getMenuConstructor().create({
         items: menuItems
       });
@@ -313,6 +395,9 @@
         if (!grid.view.hasValidState()) {
           return;
         }
+        if (grid.isGrouped) {
+          return;
+        }
         if (!grid.view.isActiveView()) {
           // The view where the context menu is being opened must be active
           // See issue https://issues.openbravo.com/view.php?id=20872
@@ -328,6 +413,13 @@
 
     var ret = this.Super('initWidget', arguments);
 
+    // only show summary rows if there are summary functions
+    for (i = 0; i < this.getFields().length; i++) {
+      if (this.getFields()[i].summaryFunction) {
+        this.showGridSummary = true;
+      }
+    }
+
     // only personalize if there is a professional license
     if (!OB.Utilities.checkProfessionalLicense(null, true)) {
       vwState = this.view.standardWindow.getDefaultGridViewState(this.view.tabId);
@@ -348,6 +440,284 @@
     this.Super('clearFilter', arguments);
   },
 
+  // select the first field after the frozen fields
+  // as the one to use for grouping headers
+  getGroupTitleField: function () {
+    var frozenFields = this.frozenFields;
+    if (frozenFields) {
+      // first field after frozen section
+      return this.getField(frozenFields.length).name;
+    }
+    // field number 2 is the first one after the standard frozen section
+    return this.getField(2).name;
+  },
+
+  // prevent a jscript error if there are no group summary functions
+  getGroupSummaryData: function () {
+    var ret = this.Super('getGroupSummaryData', arguments);
+    if (isc.isAn.Array(ret) && !ret[0]) {
+      return [{}];
+    }
+    return ret;
+  },
+
+  // Overridden to sort before grouping, so that groups are sorted
+  // and open initial group, move the group field to the left,
+  // or put it back when ungrouping
+  groupBy: function (fields) {
+    var fld, currentGroupByFields, currentGroupByField;
+
+    // move the current group column to where it came from
+    currentGroupByFields = this.getGroupByFields();
+
+    // no changes go away
+    if (!currentGroupByFields && !fields) {
+      return;
+    } else if (fields === currentGroupByFields) {
+      return;
+    }
+
+    if (currentGroupByFields && currentGroupByFields[0]) {
+      currentGroupByField = this.getField(currentGroupByFields[0]);
+      currentGroupByField.canReorder = true;
+      currentGroupByField.canHide = true;
+      this.reorderField(this.getFieldNum(currentGroupByField), currentGroupByField.previousFieldNum);
+    }
+
+    // first sort so that groups are correctly sorted
+    if (fields) {
+      if (isc.isAn.Array(fields)) {
+        fld = fields[0];
+      } else {
+        fld = fields;
+      }
+      this.getField(fld).previousFieldNum = this.getFieldNum(fld);
+      fld = this.getField(fld);
+      fld.canReorder = false;
+      fld.canHide = false;
+      this.reorderField(this.getFieldNum(fld), 0);
+      this.sort(fld);
+    }
+
+    this.Super('groupBy', arguments);
+
+    this.view.toolBar.updateButtonState(true);
+
+    // when there was already a group open, changing the group by
+    // starts with all groups closed, explicitly open the first group
+    if (fields && currentGroupByFields) {
+      this.openInitialGroups();
+    }
+
+    this.view.standardWindow.storeViewState();
+  },
+
+  clearGroupBy: function () {
+    var currentGroupByFields, currentGroupByField;
+
+    // reason for clearing was large dataset, tell the user
+    if (this.data && this.data.getLength() > this.groupByMaxRecords) {
+      // move the current group column to where it came from
+      currentGroupByFields = this.getGroupByFields();
+      if (currentGroupByFields && currentGroupByFields[0]) {
+        currentGroupByField = this.getField(currentGroupByFields[0]);
+        currentGroupByField.canReorder = true;
+        currentGroupByField.canHide = true;
+        this.reorderField(this.getFieldNum(currentGroupByField), currentGroupByField.previousFieldNum);
+      }
+
+      this.Super('clearGroupBy');
+
+      this.view.standardWindow.storeViewState();
+
+      isc.say(OB.I18N.getLabel('OBUIAPP_MaxGroupingReached', [this.groupByMaxRecords]));
+    } else {
+      this.Super('clearGroupBy');
+    }
+  },
+
+  // Overrides the standard SC function as that function
+  // also returns the default summary function from the 
+  // type definition. We only want the explicitly set
+  // summary functions.
+  getGridSummaryFunction: function (field) {
+    if (!field) {
+      return;
+    }
+    return field.summaryFunction;
+  },
+
+  // when the summary information changes, refresh
+  // the grid in the correct way
+  setSummaryFunctionActions: function (clear) {
+    var i, noSummaryFunction;
+    if (this.isGrouped) {
+      this.regroup();
+    }
+    if (!clear) {
+      if (!this.showGridSummary) {
+        this.setShowGridSummary(true);
+      }
+      this.recalculateGridSummary();
+    } else if (this.showGridSummary) {
+      noSummaryFunction = true;
+      for (i = 0; i < this.getFields().length; i++) {
+        if (this.summaryFunction) {
+          noSummaryFunction = false;
+          break;
+        }
+      }
+      if (noSummaryFunction) {
+        this.setShowGridSummary(false);
+      } else {
+        this.recalculateGridSummary();
+      }
+    }
+  },
+
+  getHeaderContextMenuItems: function (colNum) {
+    var field = this.getField(colNum),
+        i, summarySubMenu = [],
+        grid = this,
+        groupByFields = this.getGroupByFields(),
+        type, isDate, isNumber, menuItems = this.Super('getHeaderContextMenuItems', arguments);
+
+
+    // remove the group by menu option if the field is grouped 
+    // and it does not have a submenu
+    if (groupByFields && groupByFields.contains(field.name)) {
+      for (i = 0; i < menuItems.length; i++) {
+        if (menuItems[i].groupItem && !menuItems[i].submenu) {
+          menuItems.removeAt(i);
+          break;
+        }
+      }
+    }
+
+    if (field) {
+      type = isc.SimpleType.getType(field.type);
+      isDate = isc.SimpleType.inheritsFrom(type, 'date');
+      isNumber = isc.SimpleType.inheritsFrom(type, 'integer') || isc.SimpleType.inheritsFrom(type, 'float');
+
+      if (isNumber) {
+        summarySubMenu.add({
+          title: OB.I18N.getLabel('OBUIAPP_SummaryFunctionSum'),
+          // enabled: field.summaryFunction != 'sum',
+          checked: field.summaryFunction === 'sum',
+          click: function (target, item) {
+            field.summaryFunction = 'sum';
+            grid.setSummaryFunctionActions();
+          }
+        });
+
+        summarySubMenu.add({
+          title: OB.I18N.getLabel('OBUIAPP_SummaryFunctionAvg'),
+          // enabled: field.summaryFunction != 'avg',
+          checked: field.summaryFunction === 'avg',
+          click: function (target, item) {
+            field.summaryFunction = 'avg';
+            grid.setSummaryFunctionActions();
+          }
+        });
+      }
+
+      summarySubMenu.add({
+        title: OB.I18N.getLabel('OBUIAPP_SummaryFunctionMin'),
+        checked: field.summaryFunction === 'min',
+        click: function (target, item) {
+          field.summaryFunction = 'min';
+          grid.setSummaryFunctionActions();
+        }
+      });
+
+      summarySubMenu.add({
+        title: OB.I18N.getLabel('OBUIAPP_SummaryFunctionMax'),
+        checked: field.summaryFunction === 'max',
+        click: function (target, item) {
+          field.summaryFunction = 'max';
+          grid.setSummaryFunctionActions();
+        }
+      });
+
+      summarySubMenu.add({
+        title: OB.I18N.getLabel('OBUIAPP_SummaryFunctionCount'),
+        // enabled: field.summaryFunction != 'count',
+        checked: field.summaryFunction === 'count',
+        click: function (target, item) {
+          field.summaryFunction = 'count';
+          grid.setSummaryFunctionActions();
+        }
+      });
+
+      menuItems.add({
+        isSeparator: true
+      });
+
+      menuItems.add({
+        groupItem: true,
+        title: OB.I18N.getLabel('OBUIAPP_SetSummaryFunction'),
+        fieldName: field.name,
+        targetField: field,
+        prompt: OB.I18N.getLabel('OBUIAPP_SetSummaryFunction_Description'),
+        canSelectParent: true,
+        submenu: summarySubMenu
+      });
+
+      if (field.summaryFunction) {
+        menuItems.add({
+          title: OB.I18N.getLabel('OBUIAPP_ClearSummaryFunction'),
+          targetField: field,
+          click: function (target, item) {
+            delete field.summaryFunction;
+            grid.setSummaryFunctionActions(true);
+          }
+        });
+      }
+
+      menuItems.add({
+        title: OB.I18N.getLabel('OBUIAPP_ClearSummaries'),
+        targetField: field,
+        click: function (target, item) {
+          var i, fld;
+          for (i = 0; i < grid.getFields().length; i++) {
+            fld = grid.getFields()[i];
+            delete fld.summaryFunction;
+          }
+          grid.setSummaryFunctionActions(true);
+        }
+      });
+    }
+
+    // add the summary functions
+    return menuItems;
+  },
+
+  // overridden to load all data in one request
+  requestVisibleRows: function () {
+    // fake smartclient to think that there groupByMaxRecords + 1 records
+    if (this.data && this.isGrouped && !this.data.allRows) {
+      this.data.totalRows = this.groupByMaxRecords + 1;
+    }
+    this.Super('requestVisibleRows', arguments);
+  },
+
+  // Overridden to make sure that the group header is not shown in
+  // the frozen body
+  getGroupNodeHTML: function (node, gridBody) {
+    var isFrozenBody = this.frozenBody === gridBody;
+    if (this.frozenBody && isFrozenBody) {
+      return this.emptyCellValue;
+    }
+    var state = this.data.isOpen(node) ? 'opened' : 'closed',
+        url = isc.Img.urlForState(this.groupIcon, null, null, state),
+        iconIndent = isc.Canvas.spacerHTML(this.groupIconPadding, 1),
+        groupIndent = isc.Canvas.spacerHTML((this.data.getLevel(node) - 1) * this.groupIndentSize + this.groupLeadingIndent, 1);
+    var img = this.imgHTML(url, this.groupIconSize, this.groupIconSize);
+    var retStr = (this.canCollapseGroup ? groupIndent + img + iconIndent + this.getGroupTitle(node) : groupIndent + iconIndent + this.getGroupTitle(node));
+
+    return retStr;
+  },
+
   filterEditorSubmit: function () {
     // hide the messagebar
     this.view.messageBar.hide();
@@ -355,7 +725,7 @@
   },
 
   // destroy the context menu also
-  // see why this needs to be done in the 
+  // see why this needs to be done in the
   // documentation of canvas.contextMenu in Canvas.js
   destroy: function () {
     var i, field, fields = this.getFields(),
@@ -450,10 +820,18 @@
   },
 
   getCellAlign: function (record, rowNum, colNum) {
-    var fld = this.getFields()[colNum];
+    var fld = this.getFields()[colNum],
+        isRTL = this.isRTL(),
+        func = this.getGridSummaryFunction(fld),
+        isSummary = record && (record[this.groupSummaryRecordProperty] || record[this.gridSummaryRecordProperty]);
     if (!fld.clientClass && rowNum === this.getEditRow()) {
       return 'center';
     }
+
+    if (isSummary && func === 'count') {
+      return isRTL ? isc.Canvas.LEFT : isc.Canvas.RIGHT;
+    }
+
     return this.Super('getCellAlign', arguments);
   },
 
@@ -472,12 +850,42 @@
   },
 
   cellHoverHTML: function (record, rowNum, colNum) {
+
     var ret, field = this.getField(colNum),
         cellErrors, msg = '',
-        i;
+        prefix = '',
+        i, func = this.getGridSummaryFunction(field),
+        isGroupOrSummary = record && (record[this.groupSummaryRecordProperty] || record[this.gridSummaryRecordProperty]);
+
+    if (!record) {
+      return;
+    }
+
+    if (func && (isGroupOrSummary)) {
+      if (func === 'sum') {
+        prefix = OB.I18N.getLabel('OBUIAPP_SummaryFunctionSum');
+      }
+      if (func === 'min') {
+        prefix = OB.I18N.getLabel('OBUIAPP_SummaryFunctionMin');
+      }
+      if (func === 'max') {
+        prefix = OB.I18N.getLabel('OBUIAPP_SummaryFunctionMax');
+      }
+      if (func === 'count') {
+        prefix = OB.I18N.getLabel('OBUIAPP_SummaryFunctionCount');
+      }
+      if (func === 'avg') {
+        prefix = OB.I18N.getLabel('OBUIAPP_SummaryFunctionAvg');
+      }
+      if (prefix) {
+        prefix = prefix + ' ';
+      }
+    }
+
     if (this.isCheckboxField(field)) {
       return OB.I18N.getLabel('OBUIAPP_GridSelectColumnPrompt');
     }
+
     if (this.cellHasErrors(rowNum, colNum)) {
       cellErrors = this.getCellErrors(rowNum, colNum);
       // note cellErrors can be a string or array
@@ -493,7 +901,7 @@
     this.inCellHoverHTML = true;
     ret = this.Super('cellHoverHTML', arguments);
     delete this.inCellHoverHTML;
-    return ret;
+    return prefix + (ret ? ret : '');
   },
 
   reorderField: function (fieldNum, moveToPosition) {
@@ -534,7 +942,7 @@
 
   // also store the filter criteria
   getViewState: function (returnObject, includeFilter) {
-    var state = this.Super('getViewState', [returnObject || true]);
+    var i, fld, state = this.Super('getViewState', [returnObject || true]);
 
     if (includeFilter) {
       state.filter = this.getCriteria();
@@ -544,6 +952,17 @@
       }
     }
 
+    // set summary information, can not be stored in the field state
+    // because smartclient does not provide a nice override point
+    // when setting the fieldstate back to also set the summary function
+    state.summaryFunctions = {};
+    for (i = 0; i < this.getAllFields().length; i++) {
+      fld = this.getAllFields()[i];
+      if (fld.summaryFunction && isc.isA.String(fld.summaryFunction)) {
+        state.summaryFunctions[fld.name] = fld.summaryFunction;
+      }
+    }
+
     // get rid of the selected state
     delete state.selected;
 
@@ -556,7 +975,8 @@
   },
 
   setViewState: function (state) {
-    var localState;
+    var localState, i, fld, hasSummaryFunction;
+
     localState = this.evalViewState(state, 'viewState');
 
     // strange case, sometimes need to call twice
@@ -574,7 +994,21 @@
       delete localState.selected;
       this.deselectAllRecords();
 
-      // remove focus as this results in blur behavior before the 
+      if (localState.summaryFunctions) {
+        hasSummaryFunction = false;
+        for (i = 0; i < this.getAllFields().length; i++) {
+          fld = this.getAllFields()[i];
+          if (localState.summaryFunctions[fld.name]) {
+            hasSummaryFunction = true;
+            fld.summaryFunction = localState.summaryFunctions[fld.name];
+          } else {
+            delete fld.summaryFunction;
+          }
+        }
+        this.setShowGridSummary(hasSummaryFunction);
+      }
+
+      // remove focus as this results in blur behavior before the
       // (filter)editor is redrawn with new fields when
       // doing setviewstate
       // https://issues.openbravo.com/view.php?id=21249
@@ -608,7 +1042,43 @@
     }
   },
 
-  //Deletes the implicit filter on the selected record of the parent
+  // overridden to also store the group mode
+  // http://forums.smartclient.com/showthread.php?p=93877#post93877
+  getGroupState: function () {
+    var i, fld, state = this.Super('getGroupState', arguments),
+        result = {};
+    result.groupByFields = state;
+    result.groupingModes = {};
+    for (i = 0; i < this.getFields().length; i++) {
+      fld = this.getFields()[i];
+      if (fld.groupingMode) {
+        result.groupingModes[fld.name] = fld.groupingMode;
+      }
+    }
+    return result;
+  },
+
+  setGroupState: function (state) {
+    var i, fld, key;
+    if (state && (state.groupByFields || state.groupByFields === '')) {
+      if (state.groupingModes) {
+        for (key in state.groupingModes) {
+          if (state.groupingModes.hasOwnProperty(key)) {
+            fld = this.getField(key);
+            if (fld) {
+              fld.groupingMode = state.groupingModes[key];
+            }
+          }
+        }
+      }
+      this.Super('setGroupState', [state.groupByFields]);
+    } else {
+      // older state definition
+      this.Super('setGroupState', arguments);
+    }
+  },
+
+  // Deletes the implicit filter on the selected record of the parent
   deleteSelectedParentRecordFilter: function (state) {
     var i, filterLength, filterItem;
     if (state.filter) {
@@ -616,7 +1086,7 @@
       for (i = 0; i < filterLength; i++) {
         filterItem = state.filter.criteria[i];
         if (filterItem.fieldName === this.view.parentProperty) {
-          //This way it is ensured that the sub tabs will not show the registers associated with
+          // This way it is ensured that the sub tabs will not show the registers associated with
           // the register of its parent tab that was selected when the filter was created
           state.filter.criteria[i].value = '-1';
           break;
@@ -625,8 +1095,38 @@
     }
   },
 
+  getSummaryRowDataSource: function () {
+    if (this.getSummarySettings()) {
+      return this.getDataSource();
+    }
+  },
+
+  getSummaryRowFetchRequestConfig: function () {
+    var fld, i, summary = this.getSummarySettings(),
+        config = this.Super('getSummaryRowFetchRequestConfig', arguments);
+    if (summary) {
+      config.params = config.params || {};
+      config.params._summary = summary;
+      config.params = this.getFetchRequestParams(config.params);
+    }
+    return config;
+  },
+
+  getSummarySettings: function () {
+    var fld, i, summary;
+
+    for (i = 0; i < this.getFields().length; i++) {
+      fld = this.getFields()[i];
+      if (fld.summaryFunction && isc.OBViewGrid.SUPPORTED_SUMMARY_FUNCTIONS.contains(fld.summaryFunction)) {
+        summary = summary || {};
+        summary[fld.displayField || fld.name] = fld.summaryFunction;
+      }
+    }
+    return summary;
+  },
+
   setView: function (view) {
-    var dataPageSizeaux, length, i, crit;
+    var dataPageSizeaux, length, i, crit, groupByMaxRecords;
 
     this.view = view;
 
@@ -637,8 +1137,8 @@
       this.getField(this.view.parentProperty).canEdit = false;
     }
 
-    //// Begins-added to have the additional filter clause and tabid..Mallikarjun M
-    //URL example:http://localhost:8080/openbravo/?tabId=186&filterClause=e.businessPartner.searchKey%3D%27mcgiver%27&replaceDefaultFilter=true&
+    // Begins-added to have the additional filter clause and tabid..Mallikarjun M
+    // URL example:http://localhost:8080/openbravo/?tabId=186&filterClause=e.businessPartner.searchKey%3D%27mcgiver%27&replaceDefaultFilter=true&
     if (this.view.tabId === this.view.standardWindow.additionalFilterTabId) {
 
       if (!this.filterClause || this.view.standardWindow.replaceDefaultFilter === 'true') {
@@ -647,7 +1147,7 @@
         this.filterClause = '((' + this.filterClause + ') and (' + unescape(this.view.standardWindow.additionalFilterClause) + '))';
       }
     }
-    //// Ends..
+    // Ends..
     if (this.view.tabId === this.view.standardWindow.additionalCriteriaTabId && this.view.standardWindow.additionalCriteria) {
       crit = isc.JSON.decode(unescape(this.view.standardWindow.additionalCriteria));
       this.setCriteria(crit);
@@ -667,9 +1167,13 @@
         }
       }
     }
-    //Modify the quantity of lines to count per Window
-    dataPageSizeaux = OB.PropertyStore.get('dataPageSize', this.view.windowId);
+    // Modify the quantity of lines to count per Window
+    dataPageSizeaux = OB.PropertyStore.get('dataPageSize', this.view.standardWindow.windowId);
     this.dataPageSize = dataPageSizeaux ? +dataPageSizeaux : 100;
+
+    groupByMaxRecords = OB.PropertyStore.get('OBUIAPP_GroupingMaxRecords', this.view.standardWindow.windowId);
+    this.groupByMaxRecords = groupByMaxRecords ? +groupByMaxRecords : 1000;
+    this.canGroupBy = 'Y' === OB.PropertyStore.get('OBUIAPP_GroupingEnabled', this.view.standardWindow.windowId);
   },
 
   show: function () {
@@ -761,7 +1265,7 @@
         if (editRow) {
           me.startEditing(editRow - 1);
         }
-        return false; //To avoid keyboard shortcut propagation
+        return false; // To avoid keyboard shortcut propagation
       } else {
         return true;
       }
@@ -778,7 +1282,7 @@
         if (editRow || editRow === 0) {
           me.startEditing(editRow + 1);
         }
-        return false; //To avoid keyboard shortcut propagation
+        return false; // To avoid keyboard shortcut propagation
       } else {
         return true;
       }
@@ -790,7 +1294,7 @@
     ksAction_CancelEditing = function () {
       if (me.getEditForm()) {
         me.cancelEditing();
-        return false; //To avoid keyboard shortcut propagation
+        return false; // To avoid keyboard shortcut propagation
       } else {
         return true;
       }
@@ -801,7 +1305,7 @@
       var isDeletingEnabled = !me.view.toolBar.getLeftMember(isc.OBToolbar.TYPE_DELETE).disabled;
       if (me.getSelectedRecords().length > 0 && isDeletingEnabled) {
         me.view.deleteSelectedRows();
-        return false; //To avoid keyboard shortcut propagation
+        return false; // To avoid keyboard shortcut propagation
       } else {
         return true;
       }
@@ -812,7 +1316,7 @@
       if (me.getSelectedRecords().length === 1) {
         me.endEditing();
         me.startEditing(me.getRecordIndex(me.getSelectedRecords()[0]));
-        return false; //To avoid keyboard shortcut propagation
+        return false; // To avoid keyboard shortcut propagation
       } else {
         return true;
       }
@@ -823,7 +1327,7 @@
       if (me.getSelectedRecords().length === 1) {
         me.endEditing();
         me.view.editRecord(me.getSelectedRecords()[0]);
-        return false; //To avoid keyboard shortcut propagation
+        return false; // To avoid keyboard shortcut propagation
       } else {
         return true;
       }
@@ -879,7 +1383,7 @@
       return;
     }
     var newValue = '',
-        length = this.data.getLength();
+        length = isc.isA.Tree(this.data) ? this.countGroupContent() : this.data.getLength();
     if (length > this.dataPageSize) {
       newValue = '>' + this.dataPageSize;
     } else if (length === 0) {
@@ -893,6 +1397,17 @@
     }
   },
 
+  countGroupContent: function () {
+    var i, cnt = 0,
+        data = this.data.getRange(0, this.groupByMaxRecords + 1);
+    for (i = 0; i < data.length; i++) {
+      if (!data[i].isFolder) {
+        cnt++;
+      }
+    }
+    return cnt;
+  },
+
   refreshContents: function (callback) {
     var selectedValues, context;
 
@@ -932,7 +1447,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') {
+    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>';
@@ -1010,14 +1525,6 @@
     return ret;
   },
 
-  // overridden to prevent the filter editor fields from using the 
-  // grids datasource
-  getFilterEditorProperties: function (field) {
-    return isc.addProperties({
-      optionDataSource: null
-    }, this.Super('getFilterEditorProperties', arguments));
-  },
-
   removeOrClause: function (criteria) {
     // The original criteria is stored in the position #0
     // The criteria to select the recently created records is stored in position #1..length-1
@@ -1062,7 +1569,6 @@
         });
       }
 
-
       this._criteriaWithOrClause = true;
       criteria._constructor = 'AdvancedCriteria';
       criteria._OrExpression = true; // trick to get a really _or_ in the backend
@@ -1320,10 +1826,10 @@
           internalCriteria.removeAt(i);
         } else {
           var fieldName;
-          //The first name a date time field is filtered, the fieldName is stored in criteria.criteria[i].criteria[0].fieldName
+          // The first name a date time field is filtered, the fieldName is stored in criteria.criteria[i].criteria[0].fieldName
           if (criteria.criteria[i].criteria && criteria.criteria[i].criteria[0]) {
             fieldName = criteria.criteria[i].criteria[0].fieldName;
-          } else { //After the first time, the fieldName is stored in criteria.criteria[i].fieldName
+          } else { // After the first time, the fieldName is stored in criteria.criteria[i].fieldName
             fieldName = criteria.criteria[i].fieldName;
           }
 
@@ -1363,7 +1869,7 @@
         this.filterClause = null;
       }
 
-      // this mode means that no parent is selected but the parent needs to be 
+      // this mode means that no parent is selected but the parent needs to be
       // determined from the target record and the parent property
       if (this.isOpenDirectMode && this.view.parentView) {
         params._filterByParentProperty = this.view.parentProperty;
@@ -1470,7 +1976,7 @@
       parentIsNew = parentIsNew || (selectedValues.length === 1 && selectedValues[0]._new);
       if (parentIsNew) {
         this.emptyMessage = '<span class="' + this.emptyMessageStyle + '">' + OB.I18N.getLabel('OBUIAPP_ParentIsNew') + '</span>';
-      } else if (selectedValues.length === 0) {
+      } else if (!selectedValues || selectedValues.length === 0) {
         this.emptyMessage = '<span class="' + this.emptyMessageStyle + '">' + OB.I18N.getLabel('OBUIAPP_NoParentSelected') + '</span>';
       } else if (selectedValues.length > 1) {
         this.emptyMessage = '<span class="' + this.emptyMessageStyle + '">' + OB.I18N.getLabel('OBUIAPP_MultipleParentsSelected') + '</span>';
@@ -1485,6 +1991,7 @@
 
   // +++++++++++++++++++++++++++++ Context menu on record click +++++++++++++++++++++++
   cellContextClick: function (record, rowNum, colNum) {
+    var isGroupOrSummary = record && (record[this.groupSummaryRecordProperty] || record[this.gridSummaryRecordProperty]);
 
     // don't do anything if right-clicking on a selected record
     if (!this.isSelected(record)) {
@@ -1492,6 +1999,11 @@
     }
 
     this.view.setAsActiveView();
+
+    if (isGroupOrSummary) {
+      return false;
+    }
+
     var ret = this.Super('cellContextClick', arguments);
     return ret;
   },
@@ -1527,7 +2039,7 @@
       });
     }
 
-    if (!this.view.singleRecord && !this.view.readOnly) {
+    if (!this.view.singleRecord && !this.view.readOnly && !this.isGrouped && !this.view.editOrDeleteOnly) {
       menuItems.add({
         title: OB.I18N.getLabel('OBUIAPP_CreateRecordInGrid'),
         keyTitle: OB.KeyboardManager.Shortcuts.getProperty('keyComb.text', 'ToolBar_NewRow', 'id'),
@@ -1552,7 +2064,7 @@
           if (isc.isA.Date(value) && field.filterEditorType === 'OBMiniDateRangeItem') {
             grid.filterEditor.getEditForm().getField(field.name).setSingleDateValue(value);
           } else {
-            grid.filterEditor.getEditForm().setValue(field.name, value);
+            grid.filterEditor.getEditForm().setValue(field.name, OB.Utilities.encodeSearchOperator(value));
           }
           var criteria = grid.filterEditor.getEditForm().getValuesAsCriteria();
           grid.checkShowFilterFunnelIcon(criteria);
@@ -1573,7 +2085,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'),
@@ -1826,10 +2338,29 @@
   // overridden to prevent the checkbox to be shown when only one
   // record is selected.
   getCellValue: function (record, recordNum, fieldNum, gridBody) {
-    var field = this.fields[fieldNum];
+    var field = this.fields[fieldNum],
+        value, isEditRow = (recordNum === this.getEditRow()),
+        wasGrouped, func = this.getGridSummaryFunction(field),
+        isGroupOrSummary = record && (record[this.groupSummaryRecordProperty] || record[this.gridSummaryRecordProperty]);
+
+    // no checkbox in checkbox column for summary row
+    if (isGroupOrSummary && this.isCheckboxField(field)) {
+      return '';
+    }
+
     if (!field || this.allSelected) {
       return this.Super('getCellValue', arguments);
     }
+
+    if (isGroupOrSummary) {
+      // handle count much simpler than smartclient does
+      // so no extra titles or formatting
+      if (!this.getGroupByFields().contains(field.name) && func === 'count' && (record[field.name] === 0 || record[field.name])) {
+        return record[field.name];
+      }
+      return this.Super('getCellValue', arguments);
+    }
+
     // do all the cases which are handled in the super directly
     if (this.isCheckboxField(field)) {
       // NOTE: code copied from super class
@@ -1852,7 +2383,16 @@
 
       return html;
     } else {
-      return this.Super('getCellValue', arguments);
+      // prevent group style behavior for edit rows
+      if (isEditRow && this.isGrouped) {
+        wasGrouped = true;
+        this.isGrouped = false;
+      }
+      value = this.Super('getCellValue', arguments);
+      if (wasGrouped) {
+        this.isGrouped = true;
+      }
+      return value;
     }
   },
 
@@ -1952,7 +2492,7 @@
       id: '_' + new Date().getTime()
     };
 
-    this.data.insertCacheData(record, rowNum);
+    this.addToCacheData(record, rowNum);
     this.scrollToRow(rowNum);
     this.updateRowCountDisplay();
     this.view.toolBar.updateButtonState(true);
@@ -1961,11 +2501,17 @@
     this.markForRedraw();
   },
 
+  addToCacheData: function (record, rowNum) {
+    // originalData is used when the grid is grouped
+    var data = this.originalData || this.data;
+    data.insertCacheData(record, rowNum);
+  },
+
   editFailed: function (rowNum, colNum, newValues, oldValues, editCompletionEvent, dsResponse, dsRequest) {
     var record = this.getRecord(rowNum),
         editRow, editSession, view = this.view;
 
-    // set the default error message, 
+    // set the default error message,
     // is possibly overridden in the next call
     if (record) {
       if (!record[isc.OBViewGrid.ERROR_MESSAGE_PROP]) {
@@ -1998,7 +2544,13 @@
     var record = this.getRecord(rowNum),
         editRow, editSession, autoSaveAction, keepSelection;
 
-    // a new id has been computed use that now    
+    // this happens when the record change causes a group name
+    // change and therefore a group collapse
+    if (!record) {
+      return;
+    }
+
+    // a new id has been computed use that now
     if (record && record._newId) {
       record.id = record._newId;
       delete record._newId;
@@ -2079,7 +2631,7 @@
       return record[this.recordCustomStyleProperty];
     }
 
-    if (!this.view.isActiveView() && record[this.selection.selectionProperty]) {
+    if (!this.view.isActiveView() && record && record[this.selection.selectionProperty]) {
       return this.recordStyleSelectedViewInActive;
     }
 
@@ -2199,7 +2751,7 @@
     // how many arguments are passed on, sometimes the newValue is not passed in
     // and then it must be recomputed, so if we then use the undefined newValue
     // in the actionObject below things will go wrong
-    if (arguments.length < 2) {
+    if (arguments.length < 2 && this.view.allowNewRow()) {
       newValue = this.getEditValue(rowNum, colNum);
     }
 
@@ -2244,7 +2796,7 @@
     var ret, i, length = this.getFields().length;
     this._inGetNextEditCell = true;
     // past the last row
-    if (editCompletionEvent === isc.ListGrid.ENTER_KEYPRESS && rowNum === (this.getTotalRows() - 1)) {
+    if (editCompletionEvent === isc.ListGrid.ENTER_KEYPRESS && rowNum === (this.getTotalRows() - 1) && this.view.allowNewRow()) {
       // move to the next row
       ret = this.findNextEditCell(rowNum + 1, 0, 1, true, true);
 
@@ -2262,7 +2814,7 @@
 
     // when moving between rows with the arrow keys, force the focus in the correct 
     // column
-    if (ret && ret[0] !== rowNum && this.getField(colNum) && (editCompletionEvent === isc.ListGrid.UP_ARROW_KEYPRESS || editCompletionEvent === isc.ListGrid.DOWN_ARROW_KEYPRESS)) {
+    if (ret && ret[0] !== rowNum && this.getField(colNum) && (editCompletionEvent === isc.ListGrid.UP_ARROW_KEYPRESS || editCompletionEvent === isc.ListGrid.DOWN_ARROW_KEYPRESS) && this.view.allowNewRow()) {
       this.forceFocusColumn = this.getField(colNum).name;
     }
 
@@ -2270,6 +2822,11 @@
     return ret;
   },
 
+  //used in Edit or Delete only UI pattern
+  setListEndEditAction: function () {
+    this.listEndEditAction = "done";
+  },
+
   // overridden to take into account disabled at item level
   // only used when computing the next edit cell
   // if caneditcell returns false in other cases then smartclient
@@ -2719,9 +3276,10 @@
   // +++++++++++++++++ functions for the edit-link column +++++++++++++++++
   createRecordComponent: function (record, colNum) {
     var fld = this.getFields()[colNum],
+        isSummary = record[this.groupSummaryRecordProperty],
         canvas, rowNum = this.getRecordIndex(record),
         isEditRecord = rowNum === this.getEditRow();
-    if (this.isEditLinkColumn(colNum)) {
+    if (!isSummary && this.isEditLinkColumn(colNum)) {
       var layout = isc.OBGridButtonsComponent.create({
         record: record,
         grid: this
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Mon Oct 29 09:55:52 2012 +0100
@@ -71,6 +71,7 @@
 
   UI_PATTERN_READONLY: 'RO',
   UI_PATTERN_SINGLERECORD: 'SR',
+  UI_PATTERN_EDITORDELETEONLY: 'ED',
   UI_PATTERN_STANDARD: 'ST'
 });
 
@@ -185,6 +186,7 @@
 
   readOnly: false,
   singleRecord: false,
+  editOrDeleteOnly: false,
 
   isShowingForm: false,
   isEditingGrid: false,
@@ -652,10 +654,24 @@
     }
   },
 
+  setEditOrDeleteOnly: function (editOrDeleteOnly) {
+    this.editOrDeleteOnly = editOrDeleteOnly;
+    if (editOrDeleteOnly) {
+      this.viewGrid.setListEndEditAction();
+    }
+  },
+
   setSingleRecord: function (singleRecord) {
     this.singleRecord = singleRecord;
   },
 
+  allowNewRow: function () {
+    if (this.readOnly || this.singleRecord || this.editOrDeleteOnly) {
+      return false;
+    }
+    return true;
+  },
+
   setViewFocus: function () {
 
     var object, functionName, items, item, i;
@@ -675,6 +691,9 @@
     }
 
     if (this.isShowingForm && this.viewForm) {
+      if (!this.lastFocusedItem) {
+        this.lastFocusedItem = this.viewForm.getItem(this.firstFocusedField);
+      }
       if (this.lastFocusedItem && this.lastFocusedItem.getCanFocus()) {
         object = this.lastFocusedItem;
       } else if (this.viewForm.getFocusItem() && this.viewForm.getFocusItem().getCanFocus()) {
@@ -1128,20 +1147,47 @@
 
   // go to a next or previous record, if !next then the previous one is used
   editNextPreviousRecord: function (next) {
-    var rowNum, newRowNum, newRecord, currentSelectedRecord = this.viewGrid.getSelectedRecord();
+    var rowNum, increment, newRowNum, newRecord, currentSelectedRecord = this.viewGrid.getSelectedRecord();
     if (!currentSelectedRecord) {
       return;
     }
     rowNum = this.viewGrid.data.indexOf(currentSelectedRecord);
     if (next) {
-      newRowNum = rowNum + 1;
+      increment = 1;
     } else {
-      newRowNum = rowNum - 1;
+      increment = -1;
     }
+
+    newRowNum = rowNum + increment;
     newRecord = this.viewGrid.getRecord(newRowNum);
     if (!newRecord) {
       return;
     }
+    // a group and moving back, go back one more
+    if (newRecord.isFolder && increment < 0) {
+      newRowNum = newRowNum + increment;
+      newRecord = this.viewGrid.getRecord(newRowNum);
+    }
+    if (!newRecord) {
+      return;
+    }
+    if (newRecord.isFolder) {
+      if (!this.viewGrid.groupTree.isOpen(newRecord)) {
+        this.viewGrid.groupTree.openFolder(newRecord);
+      }
+      if (increment < 0) {
+        // previous, pick the last from the group
+        newRecord = newRecord.groupMembers[newRecord.groupMembers.length - 1];
+        newRowNum = this.viewGrid.getRecordIndex(newRecord);
+      } else {
+        // next, pick the first from the group
+        newRowNum = newRowNum + increment;
+        newRecord = this.viewGrid.getRecord(newRowNum);
+      }
+      if (!newRecord) {
+        return;
+      }
+    }
     this.viewGrid.scrollRecordToTop(newRowNum);
     this.editRecord(newRecord);
   },
@@ -2224,9 +2270,16 @@
         fld.filterEditorType = type.filterEditorType;
       }
 
+      if (!fld.filterEditorProperties) {
+        fld.filterEditorProperties = {};
+      }
+
       if (fld.fkField) {
         fld.displayField = fld.name + OB.Constants.FIELDSEPARATOR + OB.Constants.IDENTIFIER;
         fld.valueField = fld.name;
+        fld.filterOnKeypress = false;
+        fld.filterEditorProperties.displayField = OB.Constants.IDENTIFIER;
+        fld.filterEditorProperties.valueField = OB.Constants.IDENTIFIER;
       }
 
       if (fld.validationFn) {
@@ -2241,10 +2294,22 @@
         });
       }
 
-      if (!fld.filterEditorProperties) {
-        fld.filterEditorProperties = {};
+      fld.filterEditorProperties.required = false;
+
+      // get rid of illegal summary functions
+      if (fld.summaryFunction && !isc.OBViewGrid.SUPPORTED_SUMMARY_FUNCTIONS.contains(fld.summaryFunction)) {
+        delete fld.summaryFunction;
       }
-      fld.filterEditorProperties.required = false;
+
+      // add grouping stuff
+      if (type.inheritsFrom === 'float' || type.inheritsFrom === 'integer') {
+        // this is needed because of a bug in smartclient in Listgrid
+        // only groupingmodes on type level are considered
+        // http://forums.smartclient.com/showthread.php?p=91605#post91605
+        isc.addProperties(type, OB.Utilities.Number.Grouping);
+        // so can't define on field level 
+        //      isc.addProperties(fld, OB.Utilities.Number.Grouping);
+      }
 
       result.push(fld);
     }
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js	Mon Oct 29 09:55:52 2012 +0100
@@ -55,7 +55,14 @@
   // in the window
   dirtyEditForm: null,
 
+  allowDelete: 'Y',
+
+  allowAttachment: 'Y',
+
   initWidget: function () {
+    var me = this,
+        callback;
+
     this.views = [];
 
     this.windowLayout = isc.VLayout.create({
@@ -88,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);
@@ -104,7 +113,11 @@
     if (!this.getClass().windowSettingsRead) {
       this.readWindowSettings();
     } else if (this.getClass().windowSettingsCached) {
-      this.setWindowSettings(this.getClass().windowSettingsCached);
+      callback = function () {
+        me.setWindowSettings(me.getClass().windowSettingsCached);
+      };
+      this.fireOnPause('setWindowSettings_' + this.ID, callback);
+
     } else if (this.getClass().personalization) {
       this.setPersonalization(this.getClass().personalization);
     }
@@ -373,6 +386,7 @@
     for (i = 0; i < length; i++) {
       this.views[i].setReadOnly(data.uiPattern[this.views[i].tabId] === isc.OBStandardView.UI_PATTERN_READONLY);
       this.views[i].setSingleRecord(data.uiPattern[this.views[i].tabId] === isc.OBStandardView.UI_PATTERN_SINGLERECORD);
+      this.views[i].setEditOrDeleteOnly(data.uiPattern[this.views[i].tabId] === isc.OBStandardView.UI_PATTERN_EDITORDELETEONLY);
       this.views[i].toolBar.updateButtonState(true);
     }
 
@@ -927,7 +941,7 @@
   },
 
   closeClick: function (tab, tabSet) {
-    if (!this.activeView.viewForm.hasChanged && this.activeView.viewForm.isNew) {
+    if ((!this.activeView || !this.activeView.viewForm.hasChanged) && this.activeView.viewForm.isNew) {
       this.view.standardWindow.setDirtyEditForm(null);
     }
 
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-application-menu.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-application-menu.js	Mon Oct 29 09:55:52 2012 +0100
@@ -122,7 +122,7 @@
     var isClassicEnvironment = OB.Utilities.useClassicMode(item.windowId);
     var selectedView = isc.addProperties({}, item);
     if (item.tabId) {
-      selectedView = OB.Utilities.openView(item.windowId, item.tabId, item.title, null, null, item.icon, item.readOnly, item.singleRecord);
+      selectedView = OB.Utilities.openView(item.windowId, item.tabId, item.title, null, null, item.icon, item.readOnly, item.singleRecord, null, item.editOrDeleteOnly);
       selectedView.type = item.type;
       selectedView.icon = item.icon;
       if (selectedView) {
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quick-launch.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quick-launch.js	Mon Oct 29 09:55:52 2012 +0100
@@ -237,7 +237,7 @@
             isc.OBQuickRun.currentQuickRun.doHide();
             var openObject = isc.addProperties({}, record);
             if (record.optionType && record.optionType === 'tab') {
-              openObject = OB.Utilities.openView(record.windowId, viewValue, record[OB.Constants.IDENTIFIER], null, this.command, record.icon, record.readOnly, record.singleRecord);
+              openObject = OB.Utilities.openView(record.windowId, viewValue, record[OB.Constants.IDENTIFIER], null, this.command, record.icon, record.readOnly, record.singleRecord, null, record.editOrDeleteOnly);
               if (openObject) {
                 OB.RecentUtilities.addRecent(this.recentPropertyName, openObject);
               }
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js	Mon Oct 29 09:55:52 2012 +0100
@@ -141,7 +141,7 @@
         formFld = form.getField(gridFld.name);
         value = editRecord[gridFld.name];
         identifier = editRecord[gridFld.name + OB.Constants.FIELDSEPARATOR + OB.Constants.IDENTIFIER];
-        if (value && identifier) {
+        if (formFld && value && identifier) {
           if (formFld.setEntry) {
             formFld.setEntry(value, identifier);
           } else {
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-clone-order.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-clone-order.js	Mon Oct 29 09:55:52 2012 +0100
@@ -38,7 +38,7 @@
           var recordIndex = view.viewGrid.getRecordIndex(view.viewGrid.getSelectedRecord()) + 1;
           // takes care of transforming dates etc.
           data = view.viewGrid.getDataSource().recordsFromObjects(data)[0];
-          view.viewGrid.data.insertCacheData(data, recordIndex);
+          view.viewGrid.addToCacheData(data, recordIndex);
           view.viewGrid.scrollToRow(recordIndex);
           view.viewGrid.markForRedraw();
           var visibleRows = view.viewGrid.body.getVisibleRows();
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js	Mon Oct 29 09:55:52 2012 +0100
@@ -120,7 +120,7 @@
     updateState: function () {
       var view = this.view,
           selectedRecords = view.viewGrid.getSelectedRecords();
-      this.setDisabled(view.isShowingForm || view.readOnly || view.singleRecord || !view.hasValidState() || (selectedRecords && selectedRecords.length > 1));
+      this.setDisabled(view.viewGrid.isGrouped || view.isShowingForm || view.readOnly || view.editOrDeleteOnly || view.singleRecord || !view.hasValidState() || (selectedRecords && selectedRecords.length > 1));
     },
     keyboardShortcutId: 'ToolBar_NewRow'
   },
@@ -135,9 +135,9 @@
       var view = this.view,
           form = view.viewForm;
       if (view.isShowingForm) {
-        this.setDisabled(form.isSaving || view.readOnly || view.singleRecord || !view.hasValidState());
+        this.setDisabled(form.isSaving || view.readOnly || view.singleRecord || !view.hasValidState() || view.editOrDeleteOnly);
       } else {
-        this.setDisabled(view.readOnly || view.singleRecord || !view.hasValidState());
+        this.setDisabled(view.readOnly || view.singleRecord || !view.hasValidState() || view.editOrDeleteOnly);
       }
     },
     keyboardShortcutId: 'ToolBar_NewDoc'
@@ -172,9 +172,9 @@
         }
       }
       if (view.isShowingForm) {
-        this.setDisabled(form.isSaving || form.readOnly || view.singleRecord || !view.hasValidState() || form.isNew);
+        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);
+        this.setDisabled(view.readOnly || view.singleRecord || !view.hasValidState() || !grid.getSelectedRecords() || grid.getSelectedRecords().length === 0 || (view.standardWindow.allowDelete === 'N'));
       }
     },
     keyboardShortcutId: 'ToolBar_Eliminate'
@@ -233,7 +233,7 @@
     buttonType: 'export',
     prompt: OB.I18N.getLabel('OBUIAPP_ExportGrid'),
     updateState: function () {
-      this.setDisabled(this.view.isShowingForm || this.view.viewGrid.getTotalRows() === 0 || OB.PropertyStore.get("ExportToCsv", this.view.standardWindow.id) === 'N');
+      this.setDisabled(this.view.isShowingForm || this.view.viewGrid.getTotalRows() === 0 || OB.PropertyStore.get("ExportToCsv", this.view.standardWindow.windowId) === 'N');
     },
     keyboardShortcutId: 'ToolBar_Export'
   },
@@ -362,6 +362,10 @@
       if (this.view.viewForm.readOnly && !this.view.attachmentExists) {
         this.setDisabled(true);
       }
+      if (this.view.standardWindow.allowAttachment === 'N') {
+        this.view.viewForm.enableAttachmentsSection(false);
+        this.setDisabled(true);
+      }
     },
     keyboardShortcutId: 'ToolBar_Attachments'
   },
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js	Mon Oct 29 09:55:52 2012 +0100
@@ -334,4 +334,61 @@
     return true;
   }
   return false;
+};
+
+OB.Utilities.Number.Grouping = {
+  getGroupingModes: function () {
+    return this.groupingModes;
+  },
+  groupingModes: {
+    byDecimal10: OB.I18N.getLabel('OBUIAPP_GroupByDecimal10'),
+    by1: OB.I18N.getLabel('OBUIAPP_GroupBy1'),
+    by10: OB.I18N.getLabel('OBUIAPP_GroupBy10'),
+    by100: OB.I18N.getLabel('OBUIAPP_GroupBy100'),
+    by1000: OB.I18N.getLabel('OBUIAPP_GroupBy1000'),
+    by10000: OB.I18N.getLabel('OBUIAPP_GroupBy10000'),
+    by100000: OB.I18N.getLabel('OBUIAPP_GroupBy100000')
+  },
+  defaultGroupingMode: 'by10',
+  //default grouping mode
+  groupingMode: 'by10',
+  getGroupingMultiplier: function (groupingMode) {
+    switch (groupingMode) {
+    case 'byDecimal10':
+      return 0.1;
+    case 'by1':
+      return 1;
+    case 'by10':
+      return 10;
+    case 'by100':
+      return 100;
+    case 'by1000':
+      return 1000;
+    case 'by10000':
+      return 10000;
+    case 'by100000':
+      return 100000;
+    }
+    // default
+    return 10;
+  },
+  getGroupValue: function (value, record, field, fieldName, grid) {
+    var returnValue, groupingMode = (field.groupingMode || OB.Utilities.Number.Grouping.defaultGroupingMode),
+        multiplier = this.getGroupingMultiplier(groupingMode);
+
+    if (!isc.isA.Number(value) || !groupingMode) {
+      return value;
+    }
+    returnValue = value / multiplier;
+    // round down
+    returnValue = Math.round(returnValue - 0.49);
+    returnValue = returnValue * multiplier;
+    return returnValue;
+  },
+  getGroupTitle: function (value, record, field, fieldName, grid) {
+    var groupValue = this.getGroupValue(value, record, field, fieldName, grid),
+        groupingMode = (field.groupingMode || OB.Utilities.Number.Grouping.defaultGroupingMode),
+        multiplier = this.getGroupingMultiplier(groupingMode);
+    return groupValue + ' - ' + (groupValue + multiplier);
+  }
 };
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Mon Oct 29 09:55:52 2012 +0100
@@ -49,6 +49,18 @@
   return true;
 };
 
+//** {{{OB.Utilities.encodeSearchOperator}}} **
+//Encodes and and or in a string with a forward slash
+OB.Utilities.encodeSearchOperator = function (value) {
+  var val = value;
+  if (!val || !isc.isA.String(val)) {
+    return val;
+  }
+  val = val.replace(/ and /g, ' \\and ');
+  val = val.replace(/ or /g, ' \\or ');
+  return val;
+};
+
 // ** {{{OB.Utilities.truncTitle}}} **
 // Truncs a string after a specific length. Initial implementation is 
 // simple (just cuts of at the specified length). Returns the trunced title
@@ -382,7 +394,7 @@
 // ** {{{OB.Utilities.openView}}} **
 // Open a view taking into account if a specific window should be opened in classic mode or not.
 // Returns the object used to open the window.
-OB.Utilities.openView = function (windowId, tabId, tabTitle, recordId, command, icon, readOnly, singleRecord, direct) {
+OB.Utilities.openView = function (windowId, tabId, tabTitle, recordId, command, icon, readOnly, singleRecord, direct, editOrDeleteOnly) {
   var isClassicEnvironment = OB.Utilities.useClassicMode(windowId);
 
   var openObject;
@@ -409,7 +421,8 @@
       tabTitle: tabTitle,
       windowId: windowId,
       readOnly: readOnly,
-      singleRecord: singleRecord
+      singleRecord: singleRecord,
+      editOrDeleteOnly: editOrDeleteOnly
     };
   } else {
     openObject = {
@@ -420,7 +433,8 @@
       windowId: windowId,
       icon: icon,
       readOnly: readOnly,
-      singleRecord: singleRecord
+      singleRecord: singleRecord,
+      editOrDeleteOnly: editOrDeleteOnly
     };
   }
   if (command) {
Binary file modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/images/grid/gridSummary_bg_count.png has changed
Binary file modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/images/grid/gridSummary_bg_max.png has changed
Binary file modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/images/grid/gridSummary_bg_min.png has changed
--- a/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-grid-styles.css	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-grid-styles.css	Mon Oct 29 09:55:52 2012 +0100
@@ -251,6 +251,8 @@
 }
 
 .OBGridSummaryCell div,
+.OBGridSummaryCell_max div,
+.OBGridSummaryCell_min div,
 .OBGridSummaryCell_sum div,
 .OBGridSummaryCell_avg div,
 .OBGridSummaryCell_count div {
@@ -258,6 +260,8 @@
 }
 
 .OBGridSummaryCell,
+.OBGridSummaryCell_min,
+.OBGridSummaryCell_max,
 .OBGridSummaryCell_sum,
 .OBGridSummaryCell_avg,
 .OBGridSummaryCell_count {
@@ -272,6 +276,20 @@
   padding: 0px 4px 0px 4px;
 }
 
+.OBGridSummaryCell_min {
+  padding: 0px 4px 0px 28px;
+  background-image: url(./images/grid/gridSummary_bg_min.png);
+  background-position: 4px center;
+  background-repeat: no-repeat;
+}
+
+.OBGridSummaryCell_max {
+  padding: 0px 4px 0px 28px;
+  background-image: url(./images/grid/gridSummary_bg_max.png);
+  background-position: 4px center;
+  background-repeat: no-repeat;
+}
+
 .OBGridSummaryCell_sum {
   padding: 0px 4px 0px 14px;
   background-image: url(./images/grid/gridSummary_bg_sum.png);
--- a/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-grid-styles.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-grid-styles.js	Mon Oct 29 09:55:52 2012 +0100
@@ -59,10 +59,14 @@
     showRollOver: false
   },
   summaryRowHeight: 22,
+  groupSummaryStyle: 'OBGridSummaryCell',
   summaryRowStyle: 'OBGridSummaryCell',
+  summaryRowStyle_min: 'OBGridSummaryCell_min',
+  summaryRowStyle_max: 'OBGridSummaryCell_max',
   summaryRowStyle_sum: 'OBGridSummaryCell_sum',
   summaryRowStyle_avg: 'OBGridSummaryCell_avg',
   summaryRowStyle_count: 'OBGridSummaryCell_count',
+  groupNodeStyle: 'OBGridSummaryCell',
 
   progressIconDefaults: {
     width: 16,
--- a/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 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.18210]]></VERSION>
+<!--D393BE6F22BB44B7B728259B34FC795A-->  <VERSION><![CDATA[1.0.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 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.18210]]></STARTVERSION>
+<!--DCE798FBC5B648F7A3C81A6941720A57-->  <STARTVERSION><![CDATA[2.1.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 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.18210]]></VERSION>
+<!--4B828F4D03264080AA1D2057B13F613C-->  <VERSION><![CDATA[2.1.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 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.18210]]></STARTVERSION>
+<!--26B041893E844A53AFA58BC326C4F0D7-->  <STARTVERSION><![CDATA[3.0.18279]]></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.18210]]></STARTVERSION>
+<!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <STARTVERSION><![CDATA[1.1.18279]]></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.18210]]></STARTVERSION>
+<!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <STARTVERSION><![CDATA[2.0.18279]]></STARTVERSION>
 <!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <DEPENDANT_MODULE_NAME><![CDATA[JSON REST Webservice]]></DEPENDANT_MODULE_NAME>
 <!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/DateUIDefinition.java	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/DateUIDefinition.java	Mon Oct 29 09:55:52 2012 +0100
@@ -142,6 +142,9 @@
         + "return OB.Utilities.Date.JSToOB(value, " + getClientFormatObject() + ");" + "},"
         + "createClassicString: function(value) {" + "return OB.Utilities.Date.JSToOB(value, "
         + getClientFormatObject() + ");" + "},");
+    sb.append("getGroupingModes: isc.SimpleType.getType('date').getGroupingModes,");
+    sb.append("getGroupValue: isc.SimpleType.getType('date').getGroupValue,");
+    sb.append("getGroupTitle: isc.SimpleType.getType('date').getGroupTitle,");
     return sb.toString();
   }
 
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/ImageUIDefinition.java	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/ImageUIDefinition.java	Mon Oct 29 09:55:52 2012 +0100
@@ -45,6 +45,11 @@
   }
 
   @Override
+  public String getGridFieldProperties(Field field) {
+    return super.getGridFieldProperties(field) + ", canGroupBy: false";
+  }
+
+  @Override
   public String getFieldProperties(Field field) {
     String fieldProperties = super.getFieldProperties(field);
     try {
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/PasswordUIDefinition.java	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/PasswordUIDefinition.java	Mon Oct 29 09:55:52 2012 +0100
@@ -35,6 +35,11 @@
     return "OBEncryptedItem";
   }
 
+  @Override
+  public String getGridFieldProperties(Field field) {
+    return super.getGridFieldProperties(field) + ", canGroupBy: false";
+  }
+
   // disable display of raw-value in grid mode
   @Override
   public String getTypeProperties() {
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/YesNoUIDefinition.java	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/YesNoUIDefinition.java	Mon Oct 29 09:55:52 2012 +0100
@@ -91,7 +91,8 @@
 
   @Override
   public String getGridFieldProperties(Field field) {
-    return super.getGridFieldProperties(field) + ", width: '*', autoFitWidth: false, yesNo: true";
+    return super.getGridFieldProperties(field)
+        + ", canGroupBy: false, width: '*', autoFitWidth: false, yesNo: true";
   }
 
   @Override
--- a/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 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.18210]]></VERSION>
+<!--2758CD25B2704AF6BBAD10365FC82C06-->  <VERSION><![CDATA[2.1.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 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.18210]]></STARTVERSION>
+<!--15F51F03882F444CAB6593B4566DC929-->  <STARTVERSION><![CDATA[2.1.18279]]></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.18210]]></STARTVERSION>
+<!--E71B28FC949D481D9F59C17D01E46EF9-->  <STARTVERSION><![CDATA[3.0.18279]]></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-myopenbravo.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-myopenbravo.js	Mon Oct 29 09:55:52 2012 +0100
@@ -450,7 +450,7 @@
           });
           entryLayout.addMember(lbl);
           // if a standard window then show the new icon
-          if (recent.windowId && !recent.singleRecord && !recent.readOnly) {
+          if (recent.windowId && !recent.singleRecord && !recent.readOnly && !recent.editOrDeleteOnly) {
             // make a copy
             newRecent = isc.addProperties({}, recent);
             newRecent.command = 'NEW';
--- a/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 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.18210]]></VERSION>
+<!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <VERSION><![CDATA[1.0.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 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.18210]]></STARTVERSION>
+<!--26558497C31140BFAB067BA4BC47D799-->  <STARTVERSION><![CDATA[2.1.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 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.18210]]></VERSION>
+<!--FF8080812D842086012D844F3CC0003E-->  <VERSION><![CDATA[0.0.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 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.18210]]></STARTVERSION>
+<!--FF8080812D842086012D845002070046-->  <STARTVERSION><![CDATA[2.1.18279]]></STARTVERSION>
 <!--FF8080812D842086012D845002070046-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--FF8080812D842086012D845002070046-->  <DEPENDANT_MODULE_NAME><![CDATA[Workspace & Widgets]]></DEPENDANT_MODULE_NAME>
 <!--FF8080812D842086012D845002070046-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 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.18210]]></VERSION>
+<!--2A5EE903D7974AC298C0504FBC4501A7-->  <VERSION><![CDATA[3.0.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 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.18210]]></STARTVERSION>
+<!--A3B449C4D5FE4D688CC58236FE33B802-->  <STARTVERSION><![CDATA[3.0.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 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.18210]]></VERSION>
+<!--3A3A943684D64DEF9EC39F588A656848-->  <VERSION><![CDATA[1.1.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 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.18210]]></STARTVERSION>
+<!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <STARTVERSION><![CDATA[3.0.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 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.18210]]></VERSION>
+<!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <VERSION><![CDATA[2.1.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 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.18210]]></STARTVERSION>
+<!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <STARTVERSION><![CDATA[1.1.18279]]></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.18210]]></STARTVERSION>
+<!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <STARTVERSION><![CDATA[2.0.18279]]></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.18210]]></STARTVERSION>
+<!--4FCE95802A854F7E8623AFF7C33D13EE-->  <STARTVERSION><![CDATA[3.0.18279]]></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.18210]]></STARTVERSION>
+<!--54AF8B39C55E4E7496902893ECD82786-->  <STARTVERSION><![CDATA[2.1.18279]]></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.18210]]></STARTVERSION>
+<!--D03C56D8A4E14F45A5466350E05C631F-->  <STARTVERSION><![CDATA[8.1.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 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.18210]]></VERSION>
+<!--FF8080813129ADA401312CA1222A0005-->  <VERSION><![CDATA[0.1.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 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.18210]]></STARTVERSION>
+<!--FF8080813141B198013141BA0F7D0012-->  <STARTVERSION><![CDATA[0.1.18279]]></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.18210]]></STARTVERSION>
+<!--FF8080813151AEE1013151C4ACE6001B-->  <STARTVERSION><![CDATA[2.1.18279]]></STARTVERSION>
 <!--FF8080813151AEE1013151C4ACE6001B-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--FF8080813151AEE1013151C4ACE6001B-->  <DEPENDANT_MODULE_NAME><![CDATA[Openbravo 3.0 Framework]]></DEPENDANT_MODULE_NAME>
 <!--FF8080813151AEE1013151C4ACE6001B-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 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.18210]]></VERSION>
+<!--FF8080813141B198013141B86DD70003-->  <VERSION><![CDATA[0.1.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 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.18210]]></STARTVERSION>
+<!--FF8080813141B198013141B8B21B0006-->  <STARTVERSION><![CDATA[3.0.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 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.18210]]></VERSION>
+<!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <VERSION><![CDATA[2.0.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 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.18210]]></STARTVERSION>
+<!--9E3E7B42DB16405FB794496D309D7044-->  <STARTVERSION><![CDATA[3.0.18279]]></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	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java	Mon Oct 29 09:55:52 2012 +0100
@@ -59,6 +59,10 @@
  */
 public class AdvancedQueryBuilder {
 
+  private static final String CRITERIA_KEY = "criteria";
+  private static final String VALUE_KEY = "value";
+  private static final String FIELD_NAME_KEY = "fieldName";
+  private static final String OPERATOR_KEY = "operator";
   private static final String ALIAS_PREFIX = "alias_";
   private static final String JOIN_ALIAS_PREFIX = "join_";
   private static final char ESCAPE_CHAR = '|';
@@ -123,6 +127,8 @@
   private List<JoinDefinition> joinDefinitions = new ArrayList<JoinDefinition>();
   private String orderBy;
 
+  private List<String> selectClauseParts = new ArrayList<String>();
+
   private String orderByClause = null;
   private String whereClause = null;
   private String joinClause = null;
@@ -169,7 +175,7 @@
     Check.isNotNull(entity, "Entity must be set");
 
     // parse the criteria themselves
-    if (criteria.has("operator")) {
+    if (criteria.has(OPERATOR_KEY)) {
       try {
         whereClause = parseCriteria(criteria);
       } catch (JSONException e) {
@@ -283,23 +289,41 @@
   }
 
   private boolean hasOrAndOperator(JSONObject jsonCriteria) throws JSONException {
-    if (!jsonCriteria.has("operator")) {
+    if (!jsonCriteria.has(OPERATOR_KEY)) {
       return false;
     }
-    return OPERATOR_OR.equals(jsonCriteria.get("operator"))
-        || OPERATOR_AND.equals(jsonCriteria.get("operator"));
+    return OPERATOR_OR.equals(jsonCriteria.get(OPERATOR_KEY))
+        || OPERATOR_AND.equals(jsonCriteria.get(OPERATOR_KEY));
   }
 
   private String parseSingleClause(JSONObject jsonCriteria) throws JSONException {
-    String operator = jsonCriteria.getString("operator");
+    String operator = jsonCriteria.getString(OPERATOR_KEY);
 
     if (operator.equals(OPERATOR_BETWEEN) || operator.equals(OPERATOR_BETWEENINCLUSIVE)
         || operator.equals(OPERATOR_IBETWEEN) || operator.equals(OPERATOR_IBETWEENINCLUSIVE)) {
       return parseBetween(jsonCriteria, operator, true);
     }
 
-    String fieldName = jsonCriteria.getString("fieldName");
-    Object value = jsonCriteria.has("value") ? jsonCriteria.get("value") : null;
+    String fieldName = jsonCriteria.getString(FIELD_NAME_KEY);
+    Object value = jsonCriteria.has(VALUE_KEY) ? jsonCriteria.get(VALUE_KEY) : null;
+
+    // translate to a OR for each value
+    if (value instanceof JSONArray) {
+      final JSONArray jsonArray = (JSONArray) value;
+      final JSONObject advancedCriteria = new JSONObject();
+      advancedCriteria.put(OPERATOR_KEY, OPERATOR_OR);
+      final JSONArray subCriteria = new JSONArray();
+      for (int i = 0; i < jsonArray.length(); i++) {
+        final JSONObject subCriterion = new JSONObject();
+        subCriterion.put(OPERATOR_KEY, operator);
+        subCriterion.put(FIELD_NAME_KEY, fieldName);
+        subCriterion.put(VALUE_KEY, jsonArray.get(i));
+        subCriteria.put(i, subCriterion);
+      }
+      advancedCriteria.put(CRITERIA_KEY, subCriteria);
+      return parseAdvancedCriteria(advancedCriteria);
+    }
+
     // Retrieves the UTC time zone offset of the client
     if (jsonCriteria.has("minutesTimezoneOffset")) {
       int clientMinutesTimezoneOffset = Integer.parseInt(jsonCriteria.get("minutesTimezoneOffset")
@@ -347,7 +371,7 @@
 
   private String parseBetween(JSONObject jsonCriteria, String operator, boolean inclusive)
       throws JSONException {
-    final String fieldName = jsonCriteria.getString("fieldName");
+    final String fieldName = jsonCriteria.getString(FIELD_NAME_KEY);
     final Object start = jsonCriteria.get("start");
     final Object end = jsonCriteria.get("end");
     final String leftClause = parseSimpleClause(fieldName, getBetweenOperator(operator, false),
@@ -542,6 +566,8 @@
       clause = alias;
     }
 
+    localValue = unEscapeOperator(localValue);
+
     if (!property.isPrimitive()) {
       // an in parameter use it...
       if (localValue.toString().contains(JsonConstants.IN_PARAMETER_SEPARATOR)) {
@@ -588,12 +614,6 @@
       return value;
     }
 
-    // a FK. Old selectors is an special key, though they are not primitive they should be treated
-    // as text
-    if (!property.isPrimitive() && !(property.getDomainType() instanceof SearchDomainType)) {
-      return value;
-    }
-
     if (isLike(operator)) {
       if (operator.equals(OPERATOR_CONTAINS) || operator.equals(OPERATOR_NOTCONTAINS)
           || operator.equals(OPERATOR_INOTCONTAINS) || operator.equals(OPERATOR_ICONTAINS)
@@ -621,6 +641,12 @@
       return value;
     }
 
+    // a FK. Old selectors is an special key, though they are not primitive they should be treated
+    // as text
+    if (!property.isPrimitive() && !(property.getDomainType() instanceof SearchDomainType)) {
+      return value;
+    }
+
     if (Boolean.class == property.getPrimitiveObjectType()) {
       return new Boolean(value.toString());
     } else if (property.isNumericType()) {
@@ -664,6 +690,19 @@
     return value;
   }
 
+  @SuppressWarnings("unchecked")
+  private <T> T unEscapeOperator(T val) {
+    if (val == null || !(val instanceof String)) {
+      return val;
+    }
+    String localVal = (String) val;
+    localVal = localVal.replace("\\and", "and");
+    localVal = localVal.replace("\\or", "or");
+    localVal = localVal.replace("\\AND", "AND");
+    localVal = localVal.replace("\\OR", "OR");
+    return (T) localVal;
+  }
+
   private boolean isGreaterOperator(String operator) {
     return operator != null
         && (operator.equals(OPERATOR_GREATERTHAN) || operator.equals(OPERATOR_GREATEROREQUAL)
@@ -689,10 +728,15 @@
     final List<Property> identifierProperties = property.getEntity().getIdentifierProperties();
     Check.isTrue(identifierProperties.contains(property), "Property " + property
         + " not part of identifier of " + property.getEntity());
-    final String prefix;
+    String prefix;
     final int index = leftWherePart.lastIndexOf(DalUtil.DOT);
     if (key.equals(JsonConstants.IDENTIFIER)) {
       prefix = getMainAlias() + DalUtil.DOT;
+    } else if (key.endsWith(JsonConstants.IDENTIFIER)) {
+      final String propPath = key.substring(0, key.indexOf(JsonConstants.IDENTIFIER) - 1);
+      final String join = resolveJoins(JsonUtils.getPropertiesOnPath(getEntity(), propPath),
+          propPath);
+      prefix = join + DalUtil.DOT;
     } else if (index == -1) {
       prefix = "";
     } else {
@@ -703,20 +747,20 @@
   }
 
   private String parseAdvancedCriteria(JSONObject advancedCriteria) throws JSONException {
-    final String operator = advancedCriteria.getString("operator");
+    final String operator = advancedCriteria.getString(OPERATOR_KEY);
     if (operator.equals(OPERATOR_NOT)) {
-      final String clause = parseStructuredClause(advancedCriteria.getJSONArray("criteria"), "or");
+      final String clause = parseStructuredClause(advancedCriteria.getJSONArray(CRITERIA_KEY), "or");
       if (clause != null) {
         return " not(" + clause + ")";
       }
       return null;
     }
     if (operator.equals(OPERATOR_AND)) {
-      return parseStructuredClause(advancedCriteria.getJSONArray("criteria"), "and");
+      return parseStructuredClause(advancedCriteria.getJSONArray(CRITERIA_KEY), "and");
     }
     if (operator.equals(OPERATOR_OR)) {
       orNesting++;
-      final String value = parseStructuredClause(advancedCriteria.getJSONArray("criteria"), "or");
+      final String value = parseStructuredClause(advancedCriteria.getJSONArray(CRITERIA_KEY), "or");
       orNesting--;
       return value;
     }
@@ -727,8 +771,8 @@
     final StringBuilder sb = new StringBuilder();
     for (int i = 0; i < clauses.length(); i++) {
       final JSONObject clause = clauses.getJSONObject(i);
-      if (clause.has("value") && clause.get("value") != null
-          && clause.getString("value").equals("")) {
+      if (clause.has(VALUE_KEY) && clause.get(VALUE_KEY) != null
+          && clause.getString(VALUE_KEY).equals("")) {
         continue;
       }
       final String clauseString = parseCriteria(clause);
@@ -1145,7 +1189,6 @@
               + prefix.substring(0, prefix.lastIndexOf('.')) + " and t.language.language='"
               + OBContext.getOBContext().getLanguage().getLanguage() + "')), to_char(" + prefix
               + prop.getName() + "), '')");
-
         } else {
           sb.append("COALESCE(to_char(" + prefix + prop.getName() + "),'')");
         }
@@ -1206,7 +1249,7 @@
 
   // Resolves the list of properties against existing join definitions
   // creates new join definitions when necessary
-  private String resolveJoins(List<Property> props, String originalPath) {
+  public String resolveJoins(List<Property> props, String originalPath) {
     String alias = getMainAlias();
     if (alias == null) {
       return originalPath;
@@ -1265,6 +1308,17 @@
       return checkAlias.equals(ownerAlias) && checkProperty == property;
     }
 
+    public String getPropertyPath() {
+      if (ownerAlias != null) {
+        for (JoinDefinition jd : AdvancedQueryBuilder.this.joinDefinitions) {
+          if (jd.getJoinAlias().equals(ownerAlias)) {
+            return jd.getPropertyPath() + DalUtil.DOT + property.getName();
+          }
+        }
+      }
+      return property.getName();
+    }
+
     public String getJoinStatement() {
       if (orNesting > 0) {
         return " left outer join " + (fetchJoin ? "fetch " : "")
@@ -1296,6 +1350,10 @@
     public void setFetchJoin(boolean fetchJoin) {
       this.fetchJoin = fetchJoin;
     }
+
+    public Property getProperty() {
+      return property;
+    }
   }
 
   public String getMainAlias() {
@@ -1361,6 +1419,45 @@
     typedParameters.clear();
   }
 
+  public void addSelectFunctionPart(String function, String field) {
+    String localField = field;
+    final List<Property> properties = JsonUtils.getPropertiesOnPath(getEntity(), localField);
+    localField = resolveJoins(properties, localField);
+    if (properties.size() > 0) {
+      final Property lastProperty = properties.get(properties.size() - 1);
+      if (lastProperty.getTargetEntity() != null) {
+        final StringBuilder sb = new StringBuilder();
+        for (Property identifierProperty : lastProperty.getTargetEntity().getIdentifierProperties()) {
+          if (sb.length() > 0) {
+            sb.append(" + ");
+          }
+          sb.append(localField + "." + identifierProperty.getName());
+        }
+        localField = sb.toString();
+      }
+    }
+    selectClauseParts.add(function + "(" + localField + ")");
+  }
+
+  public void addSelectClausePart(String selectClausePart) {
+    String localSelectClausePart = selectClausePart;
+    final List<Property> properties = JsonUtils.getPropertiesOnPath(getEntity(),
+        localSelectClausePart);
+    localSelectClausePart = resolveJoins(properties, localSelectClausePart);
+    selectClauseParts.add(localSelectClausePart);
+  }
+
+  public String getSelectClause() {
+    final StringBuilder sb = new StringBuilder();
+    for (String selectClausePart : selectClauseParts) {
+      if (sb.length() > 0) {
+        sb.append(", ");
+      }
+      sb.append(selectClausePart);
+    }
+    return sb.toString();
+  }
+
   public void setAdditionalProperties(List<String> additionalProperties) {
     this.additionalProperties = additionalProperties;
   }
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DataEntityQueryService.java	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DataEntityQueryService.java	Mon Oct 29 09:55:52 2012 +0100
@@ -18,6 +18,8 @@
  */
 package org.openbravo.service.json;
 
+import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
 import org.apache.log4j.Logger;
@@ -28,8 +30,11 @@
 import org.hibernate.ScrollableResults;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.model.Entity;
+import org.openbravo.base.model.ModelProvider;
+import org.openbravo.base.model.Property;
 import org.openbravo.base.structure.BaseOBObject;
 import org.openbravo.base.util.Check;
+import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBQuery;
 
@@ -60,6 +65,11 @@
   private boolean filterOnActive = true;
   private AdvancedQueryBuilder queryBuilder = new AdvancedQueryBuilder();
 
+  private String distinct;
+
+  private String summarySettings;
+  private List<String> summaryFields = new ArrayList<String>();
+
   /**
    * Count the records which fit in the filter criteria.
    * 
@@ -101,15 +111,41 @@
     return qry.scroll(ScrollMode.FORWARD_ONLY);
   }
 
-  private OBQuery<BaseOBObject> buildOBQuery() {
+  /**
+   * Build an OBQuery object using the generated where, order by and select clauses.
+   */
+  public OBQuery<BaseOBObject> buildOBQuery() {
     final String whereOrderBy = queryBuilder.getJoinClause() + queryBuilder.getWhereClause()
-        + queryBuilder.getOrderByClause();
+        + (getSummarySettings() == null ? queryBuilder.getOrderByClause() : "");
 
     log.debug("Querying for " + entityName + " " + whereOrderBy);
 
-    // System.err.println("Querying for " + entityName + " " + whereOrderBy);
+    final OBQuery<BaseOBObject> obq = OBDal.getInstance().createQuery(entityName, whereOrderBy);
+    if (getSummarySettings() != null) {
+      obq.setSelectClause(queryBuilder.getSelectClause());
+    } else if (getDistinct() != null) {
+      final String localDistinct = getDistinct();
+      queryBuilder.addSelectClausePart(localDistinct + ".id");
 
-    final OBQuery<BaseOBObject> obq = OBDal.getInstance().createQuery(entityName, whereOrderBy);
+      final Property property = DalUtil.getPropertyFromPath(
+          ModelProvider.getInstance().getEntity(getEntityName()), localDistinct);
+
+      for (Property identifierProp : property.getTargetEntity().getIdentifierProperties()) {
+        if (identifierProp.getTargetEntity() != null) {
+          // go one level deeper
+          final List<Property> nextIdentifierProps = JsonUtils.getIdentifierSet(identifierProp);
+          for (Property nextIdentifierProp : nextIdentifierProps) {
+            queryBuilder.addSelectClausePart(localDistinct + DalUtil.DOT + identifierProp.getName()
+                + "." + nextIdentifierProp);
+          }
+        } else {
+          queryBuilder.addSelectClausePart(localDistinct + DalUtil.DOT + identifierProp.getName());
+        }
+      }
+
+      obq.setSelectClause("distinct " + queryBuilder.getSelectClause());
+    }
+
     if (getFirstResult() != null) {
       obq.setFirstResult(getFirstResult());
       log.debug("Firstresult " + getFirstResult());
@@ -240,4 +276,40 @@
     queryBuilder.clearCachedValues();
   }
 
+  public String getDistinct() {
+    return distinct;
+  }
+
+  public void setDistinct(String distinct) {
+    this.distinct = distinct.replace(DalUtil.FIELDSEPARATOR, DalUtil.DOT);
+  }
+
+  public String getSummarySettings() {
+    return summarySettings;
+  }
+
+  public void setSummarySettings(String summarySettings) {
+    this.summarySettings = summarySettings;
+    if (getSummarySettings() != null) {
+      try {
+        summaryFields.clear();
+        final JSONObject summarySetting = new JSONObject(getSummarySettings());
+        final Iterator<?> it = summarySetting.keys();
+        while (it.hasNext()) {
+          final String key = (String) it.next();
+          summaryFields.add(key);
+          final String value = summarySetting.getString(key);
+          queryBuilder.addSelectFunctionPart(value,
+              key.replace(DalUtil.FIELDSEPARATOR, DalUtil.DOT));
+        }
+      } catch (JSONException e) {
+        throw new RuntimeException(e);
+      }
+    }
+  }
+
+  public List<String> getSummaryFields() {
+    return summaryFields;
+  }
+
 }
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java	Mon Oct 29 09:55:52 2012 +0100
@@ -63,13 +63,16 @@
   // TODO: need to be revisited when client side data formatting is solved
   private final SimpleDateFormat xmlDateFormat = JsonUtils.createDateFormat();
   private final SimpleDateFormat xmlDateTimeFormat = JsonUtils.createDateTimeFormat();
-  private final static SimpleDateFormat xmlTimeFormat = JsonUtils.createTimeFormat();
+  // private final static SimpleDateFormat xmlTimeFormat = JsonUtils.createTimeFormat();
   private final static SimpleDateFormat xmlTimeFormatWithoutMTOffset = JsonUtils
       .createTimeFormatWithoutGMTOffset();
 
   // additional properties to return as a flat list
   private List<String> additionalProperties = new ArrayList<String>();
 
+  // limit the json serialization to these properties
+  private List<String> selectedProperties = new ArrayList<String>();
+
   /**
    * Convert a list of Maps with key value pairs to a list of {@link JSONObject}.
    * 
@@ -149,6 +152,12 @@
         if (isDerivedReadable && !property.allowDerivedRead()) {
           continue;
         }
+
+        // check if the property is part of the selection
+        if (selectedProperties.size() > 0 && !selectedProperties.contains(property.getName())) {
+          continue;
+        }
+
         final Object value = bob.get(property.getName());
         if (value != null) {
           if (property.isPrimitive()) {
@@ -335,4 +344,14 @@
   public void setAdditionalProperties(List<String> additionalProperties) {
     this.additionalProperties = additionalProperties;
   }
+
+  public void setSelectedProperties(String selectedPropertiesStr) {
+    if (selectedPropertiesStr == null || selectedPropertiesStr.trim().isEmpty()) {
+      return;
+    }
+    for (String selectedProp : selectedPropertiesStr.split(",")) {
+      if (!selectedProp.isEmpty())
+        selectedProperties.add(selectedProp);
+    }
+  }
 }
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Mon Oct 29 09:55:52 2012 +0100
@@ -29,9 +29,13 @@
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.ScrollableResults;
 import org.openbravo.base.exception.OBException;
+import org.openbravo.base.model.Entity;
+import org.openbravo.base.model.ModelProvider;
+import org.openbravo.base.model.Property;
 import org.openbravo.base.provider.OBProvider;
 import org.openbravo.base.structure.BaseOBObject;
 import org.openbravo.base.util.Check;
+import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.service.json.JsonToDataConverter.JsonConversionError;
@@ -131,7 +135,88 @@
         queryService = createSetQueryService(parameters, false);
         queryService.setEntityName(entityName);
 
-        bobs = queryService.list();
+        if (parameters.containsKey(JsonConstants.SUMMARY_PARAMETER)) {
+          final JSONObject singleResult = new JSONObject();
+          if (queryService.getSummaryFields().size() == 1) {
+            singleResult.put(queryService.getSummaryFields().get(0), queryService.buildOBQuery()
+                .createQuery().uniqueResult());
+          } else {
+            final Object[] os = (Object[]) queryService.buildOBQuery().createQuery().uniqueResult();
+            int i = 0;
+            if (os != null && os.length > 0) {
+              for (String key : queryService.getSummaryFields()) {
+                singleResult.put(key, os[i++]);
+              }
+            }
+          }
+          singleResult.put("isGridSummary", true);
+
+          jsonResponse.put(JsonConstants.RESPONSE_DATA,
+              new JSONArray(Collections.singleton(singleResult)));
+          jsonResponse.put(JsonConstants.RESPONSE_STATUS, JsonConstants.RPCREQUEST_STATUS_SUCCESS);
+          jsonResult.put(JsonConstants.RESPONSE_RESPONSE, jsonResponse);
+          jsonResponse.put(JsonConstants.RESPONSE_STARTROW, 0);
+          jsonResponse.put(JsonConstants.RESPONSE_ENDROW, 1);
+          jsonResponse.put(JsonConstants.RESPONSE_TOTALROWS, 1);
+          return jsonResult.toString();
+        } else if (parameters.containsKey(JsonConstants.DISTINCT_PARAMETER)) {
+          // when distinct an array of values is returned
+          // the first value is the BaseObObject the other values
+          // are part of the order by and such and can be ignored
+          final String distinct = parameters.get(JsonConstants.DISTINCT_PARAMETER);
+          final Property distinctProperty = DalUtil.getPropertyFromPath(ModelProvider.getInstance()
+              .getEntity(entityName), distinct);
+          final Entity distinctEntity = distinctProperty.getTargetEntity();
+          final List<Property> properties = new ArrayList<Property>();
+          properties.addAll(distinctEntity.getIdProperties());
+          properties.addAll(distinctEntity.getIdentifierProperties());
+
+          bobs = new ArrayList<BaseOBObject>();
+
+          List<List<Property>> cache = new ArrayList<List<Property>>();
+          for (Object o : queryService.buildOBQuery().createQuery().list()) {
+            final Object[] os = (Object[]) o;
+            if (os[0] == null) {
+              // the null value is also returned, ignore those
+              continue;
+            }
+
+            if (cache.size() == 0) {
+              for (int i = 0; i < os.length; i++) {
+                cache.add(null);
+              }
+            }
+
+            // create a BaseOBObject and fill the id/identifier properties
+            final BaseOBObject bob = (BaseOBObject) OBProvider.getInstance().get(
+                distinctEntity.getName());
+            int i = 0;
+            for (Property property : properties) {
+              // the query contains the identifier and other properties for
+              // one level deeper!
+              if (property.getTargetEntity() != null) {
+                final BaseOBObject refBob = (BaseOBObject) OBProvider.getInstance().get(
+                    property.getTargetEntity().getName());
+                final List<Property> nextIdentifierProps;
+                if (cache.get(i) != null) {
+                  nextIdentifierProps = cache.get(i);
+                } else {
+                  nextIdentifierProps = JsonUtils.getIdentifierSet(property);
+                  cache.set(i, nextIdentifierProps);
+                }
+                for (Property nextIdentifierProp : nextIdentifierProps) {
+                  refBob.setValue(nextIdentifierProp.getName(), os[i++]);
+                }
+                bob.setValue(property.getName(), refBob);
+              } else {
+                bob.setValue(property.getName(), os[i++]);
+              }
+            }
+            bobs.add(bob);
+          }
+        } else {
+          bobs = queryService.list();
+        }
 
         if (preventCountOperation) {
           count = bobs.size() + startRow;
@@ -163,6 +248,8 @@
       final DataToJsonConverter toJsonConverter = OBProvider.getInstance().get(
           DataToJsonConverter.class);
       toJsonConverter.setAdditionalProperties(JsonUtils.getAdditionalProperties(parameters));
+      toJsonConverter.setSelectedProperties(parameters
+          .get(JsonConstants.SELECTEDPROPERTIES_PARAMETER));
       final List<JSONObject> jsonObjects = toJsonConverter.toJsonObjects(bobs);
 
       addWritableAttribute(jsonObjects);
@@ -273,8 +360,20 @@
       orderBy = parameters.get(JsonConstants.ORDERBY_PARAMETER);
     }
 
-    // Always append id to the orderby to make a predictable sorting
-    orderBy += (orderBy.isEmpty() ? "" : ",") + "id";
+    if (parameters.get(JsonConstants.SUMMARY_PARAMETER) != null
+        && parameters.get(JsonConstants.SUMMARY_PARAMETER).trim().length() > 0) {
+      queryService.setSummarySettings(parameters.get(JsonConstants.SUMMARY_PARAMETER));
+    } else if (parameters.get(JsonConstants.DISTINCT_PARAMETER) != null
+        && parameters.get(JsonConstants.DISTINCT_PARAMETER).trim().length() > 0) {
+      queryService.setDistinct(parameters.get(JsonConstants.DISTINCT_PARAMETER).trim());
+      // sortby the distinct's identifier
+      orderBy = queryService.getDistinct() + DalUtil.DOT + JsonConstants.IDENTIFIER + ","
+          + queryService.getDistinct() + DalUtil.DOT + JsonConstants.ID;
+    } else {
+      // Always append id to the orderby to make a predictable sorting
+      orderBy += (orderBy.isEmpty() ? "" : ",") + "id";
+    }
+
     queryService.setOrderBy(orderBy);
 
     // compute a new startrow if the targetrecordid was passed in
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonConstants.java	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonConstants.java	Mon Oct 29 09:55:52 2012 +0100
@@ -54,6 +54,9 @@
 
   public static final String FILTERBYPARENTPROPERTY_PARAMETER = "_filterByParentProperty";
   public static final String WHERE_PARAMETER = "_where";
+  public static final String SELECTEDPROPERTIES_PARAMETER = "_selectedProperties";
+  public static final String DISTINCT_PARAMETER = "_distinct";
+  public static final String SUMMARY_PARAMETER = "_summary";
   public static final String ORDERBY_PARAMETER = "_orderBy";
   public static final String FILTER_PARAMETER = "_filter";
   public static final String ENDROW_PARAMETER = "_endRow";
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonUtils.java	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonUtils.java	Mon Oct 29 09:55:52 2012 +0100
@@ -34,6 +34,7 @@
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.Property;
 import org.openbravo.base.secureApp.VariablesSecureApp;
+import org.openbravo.base.structure.IdentifierProvider;
 import org.openbravo.client.kernel.RequestContext;
 import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.core.OBContext;
@@ -51,6 +52,24 @@
   private static final Logger log = Logger.getLogger(JsonUtils.class);
 
   /**
+   * A utility method which retrieves the properties used for identifying an entity and its first
+   * level references. Takes into accoun the different scenarios implemented in the
+   * {@link IdentifierProvider#getIdentifier(Object)} method.
+   * 
+   * Is used by distinct queries to get the smallest possible select clauses.
+   */
+  public static List<Property> getIdentifierSet(Property property) {
+    final List<Property> properties = new ArrayList<Property>();
+    final Entity entity = property.getTargetEntity();
+    properties.addAll(entity.getIdProperties());
+    properties.addAll(entity.getIdentifierProperties());
+    if (property.hasDisplayColumn()) {
+      properties.add(entity.getProperty(property.getDisplayPropertyName()));
+    }
+    return properties;
+  }
+
+  /**
    * @return a new instance of the {@link SimpleDateFormat} using a format of yyyy-MM-dd (xml schema
    *         date format). The date format has lenient set to true.
    */
--- a/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -6,7 +6,7 @@
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <NAME><![CDATA[User Interface Selector]]></NAME>
-<!--5EB4F15C80684ACA904756BDC12ADBE5-->  <VERSION><![CDATA[2.1.18210]]></VERSION>
+<!--5EB4F15C80684ACA904756BDC12ADBE5-->  <VERSION><![CDATA[2.1.18279]]></VERSION>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <DESCRIPTION><![CDATA[Provides a selector with a suggestion box and popup grid window]]></DESCRIPTION>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <HELP><![CDATA[The Openbravo selector provides new selector functionality which is used inside of existing Openbravo forms. The selector is mainly used for supporting foreign key references in the user interface. The selector combines both suggestion box behavior with a popup grid.]]></HELP>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <URL><![CDATA[http://forge.openbravo.com/projects/selector]]></URL>
--- a/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -7,7 +7,7 @@
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <AD_DEPENDENT_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_DEPENDENT_MODULE_ID>
-<!--38825CAED43941D38CA0C78DB04FCFA0-->  <STARTVERSION><![CDATA[8.1.18210]]></STARTVERSION>
+<!--38825CAED43941D38CA0C78DB04FCFA0-->  <STARTVERSION><![CDATA[8.1.18279]]></STARTVERSION>
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <DEPENDANT_MODULE_NAME><![CDATA[Smartclient]]></DEPENDANT_MODULE_NAME>
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <AD_DEPENDENT_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_DEPENDENT_MODULE_ID>
-<!--6DDE7B1A70174242AF82B5022FB89279-->  <STARTVERSION><![CDATA[2.1.18210]]></STARTVERSION>
+<!--6DDE7B1A70174242AF82B5022FB89279-->  <STARTVERSION><![CDATA[2.1.18279]]></STARTVERSION>
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Application]]></DEPENDANT_MODULE_NAME>
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <AD_DEPENDENT_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_DEPENDENT_MODULE_ID>
-<!--94F9CD2CB5EF4467A67475C786C984A7-->  <STARTVERSION><![CDATA[2.1.18210]]></STARTVERSION>
+<!--94F9CD2CB5EF4467A67475C786C984A7-->  <STARTVERSION><![CDATA[2.1.18279]]></STARTVERSION>
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Client Kernel]]></DEPENDANT_MODULE_NAME>
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -49,7 +49,7 @@
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <AD_DEPENDENT_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_DEPENDENT_MODULE_ID>
-<!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <STARTVERSION><![CDATA[1.1.18210]]></STARTVERSION>
+<!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <STARTVERSION><![CDATA[1.1.18279]]></STARTVERSION>
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <DEPENDANT_MODULE_NAME><![CDATA[JBoss Weld]]></DEPENDANT_MODULE_NAME>
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -63,7 +63,7 @@
 <!--C8DAC574B88649D08C9468521B343F12-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--C8DAC574B88649D08C9468521B343F12-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--C8DAC574B88649D08C9468521B343F12-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--C8DAC574B88649D08C9468521B343F12-->  <STARTVERSION><![CDATA[3.0.18210]]></STARTVERSION>
+<!--C8DAC574B88649D08C9468521B343F12-->  <STARTVERSION><![CDATA[3.0.18279]]></STARTVERSION>
 <!--C8DAC574B88649D08C9468521B343F12-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--C8DAC574B88649D08C9468521B343F12-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--C8DAC574B88649D08C9468521B343F12-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -77,7 +77,7 @@
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <AD_DEPENDENT_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_DEPENDENT_MODULE_ID>
-<!--F14EB17946BE4724A46F80CB1A47EC70-->  <STARTVERSION><![CDATA[2.1.18210]]></STARTVERSION>
+<!--F14EB17946BE4724A46F80CB1A47EC70-->  <STARTVERSION><![CDATA[2.1.18279]]></STARTVERSION>
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <DEPENDANT_MODULE_NAME><![CDATA[JSON Datasource]]></DEPENDANT_MODULE_NAME>
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -13,7 +13,7 @@
 <!--387D9FFC48A74054835C5DF6E6FD08F7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--387D9FFC48A74054835C5DF6E6FD08F7-->  <VALUEFIELD_ID><![CDATA[DD28F69792084E7F8EBBF2FA94F52A5F]]></VALUEFIELD_ID>
 <!--387D9FFC48A74054835C5DF6E6FD08F7-->  <DISPLAYFIELD_ID><![CDATA[DD28F69792084E7F8EBBF2FA94F52A5F]]></DISPLAYFIELD_ID>
-<!--387D9FFC48A74054835C5DF6E6FD08F7-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--387D9FFC48A74054835C5DF6E6FD08F7-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[substring]]></SUGGESTIONTEXTMATCHSTYLE>
 <!--387D9FFC48A74054835C5DF6E6FD08F7-->  <POPUPTEXTMATCHSTYLE><![CDATA[startsWith]]></POPUPTEXTMATCHSTYLE>
 <!--387D9FFC48A74054835C5DF6E6FD08F7-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
 <!--387D9FFC48A74054835C5DF6E6FD08F7--></OBUISEL_SELECTOR>
@@ -29,7 +29,7 @@
 <!--E4F389D409DF4EC3B371B69C8A124DA7-->  <OBSERDS_DATASOURCE_ID><![CDATA[5C8B84FA41CE4876B26B9E96A9E909BD]]></OBSERDS_DATASOURCE_ID>
 <!--E4F389D409DF4EC3B371B69C8A124DA7-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
 <!--E4F389D409DF4EC3B371B69C8A124DA7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--E4F389D409DF4EC3B371B69C8A124DA7-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--E4F389D409DF4EC3B371B69C8A124DA7-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[substring]]></SUGGESTIONTEXTMATCHSTYLE>
 <!--E4F389D409DF4EC3B371B69C8A124DA7-->  <POPUPTEXTMATCHSTYLE><![CDATA[startsWith]]></POPUPTEXTMATCHSTYLE>
 <!--E4F389D409DF4EC3B371B69C8A124DA7-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
 <!--E4F389D409DF4EC3B371B69C8A124DA7--></OBUISEL_SELECTOR>
--- a/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorComponent.java	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorComponent.java	Mon Oct 29 09:55:52 2012 +0100
@@ -801,8 +801,8 @@
     public String getFilterEditorProperties() {
       if (getUIDefinition() != null) {
         if (getUIDefinition() instanceof FKComboUIDefinition && isSelectorItem) {
-          return ", filterOperator: 'equals', filterOnKeypress: true, canFilter:true, required: false, filterEditorType: 'OBSelectorFilterSelectItem', filterEditorProperties: {entity: '"
-              + getEntityName() + "', displayField: '" + JsonConstants.IDENTIFIER + "'}";
+          return ", canFilter:true, required: false, filterEditorType: 'OBSelectorFilterSelectItem', filterEditorProperties: {entity: '"
+              + getEntityName() + "'}";
         }
         return getUIDefinition().getFilterEditorProperties(null);
       }
--- a/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorDefaultFilterActionHandler.java	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorDefaultFilterActionHandler.java	Mon Oct 29 09:55:52 2012 +0100
@@ -29,9 +29,14 @@
 import org.apache.log4j.Logger;
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.criterion.Restrictions;
+import org.openbravo.base.model.Entity;
+import org.openbravo.base.model.ModelProvider;
+import org.openbravo.base.model.Property;
+import org.openbravo.base.structure.BaseOBObject;
 import org.openbravo.client.application.OBBindings;
 import org.openbravo.client.kernel.BaseActionHandler;
 import org.openbravo.client.kernel.KernelConstants;
+import org.openbravo.client.kernel.KernelUtils;
 import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
@@ -61,6 +66,9 @@
       String selectorId = params.get("_selectorDefinitionId");
 
       Selector sel = OBDal.getInstance().get(Selector.class, selectorId);
+      final String entityName = sel.getTable().getName();
+      final Entity entity = ModelProvider.getInstance().getEntity(entityName);
+
       OBCriteria<SelectorField> obc = OBDal.getInstance().createCriteria(SelectorField.class);
       obc.add(Restrictions.eq(SelectorField.PROPERTY_OBUISELSELECTOR, sel));
       obc.add(Restrictions.isNotNull(SelectorField.PROPERTY_DEFAULTEXPRESSION));
@@ -81,6 +89,20 @@
         try {
           exprResult = engine.eval(f.getDefaultExpression());
 
+          if (exprResult != null && !exprResult.equals("") && !exprResult.equals("''")) {
+            Property property = null;
+            if (f.getColumn() != null) {
+              property = KernelUtils.getInstance().getPropertyFromColumn(f.getColumn());
+            } else if (f.getProperty() != null) {
+              property = DalUtil.getPropertyFromPath(entity, f.getProperty());
+            }
+            if (property != null && property.getTargetEntity() != null && !property.isOneToMany()) {
+              final BaseOBObject bob = OBDal.getInstance().get(
+                  property.getTargetEntity().getName(), exprResult);
+              exprResult = bob.getIdentifier();
+            }
+          }
+
           if (sel.isCustomQuery()) {
             result.put(f.getDisplayColumnAlias().replace(DalUtil.DOT, DalUtil.FIELDSEPARATOR),
                 exprResult);
@@ -94,6 +116,15 @@
                   + f.getDisplayColumnAlias() + ": " + e.getMessage(), e);
         }
       }
+
+      // Obtaining the filter Expression from Selector. Refer issue
+      // https://issues.openbravo.com/view.php?id=21541
+      Object dynamicFilterExpression = null;
+      if (sel.getFilterExpression() != null) {
+        dynamicFilterExpression = engine.eval(sel.getFilterExpression());
+        result.put("filterExpression", dynamicFilterExpression.toString());
+      }
+
     } catch (Exception e) {
       log.error("Error generating Default Filter action result: " + e.getMessage(), e);
     } finally {
--- a/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-filter-select-item.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-filter-select-item.js	Mon Oct 29 09:55:52 2012 +0100
@@ -16,38 +16,9 @@
  * Contributor(s):  ______________________________________.
  ************************************************************************
  */
-isc.ClassFactory.defineClass('OBSelectorFilterSelectItem', isc.SelectItem);
+isc.ClassFactory.defineClass('OBSelectorFilterSelectItem', isc.OBFKFilterTextItem);
 
 isc.OBSelectorFilterSelectItem.addProperties({
-  fetchMissingValues: true,
-  operator: 'equals',
-  valueField: OB.Constants.ID,
-
-  init: function () {
-    OB.Datasource.get(this.entity, this);
-    this.Super('init', arguments);
-  },
-
-  // prevent ids from showing up
-  mapValueToDisplay: function (value) {
-    var ret = this.Super('mapValueToDisplay', arguments);
-    if (ret === value) {
-      return '';
-    }
-    return ret;
-  },
-
-  setDataSource: function (ds) {
-    var val;
-    this.optionDataSource = ds;
-    if (this.getValue()) {
-      val = this.getValue();
-      // first clear 
-      this.setValue(null);
-      // then set again to force a load
-      this.setValue(val);
-    }
-  },
 
   filterDataBoundPickList: function (requestProperties, dropCache) {
     requestProperties = requestProperties || {};
--- a/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-widget.js	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-widget.js	Mon Oct 29 09:55:52 2012 +0100
@@ -421,6 +421,16 @@
 
     setOBTabBehavior(false);
 
+    //Adding dynamic generated filter Expression to whereClause. Refer Issue https://issues.openbravo.com/view.php?id=21541
+    if (data.filterExpression) {
+      if (this.selectorGrid.selector.whereClause) {
+        this.selectorGrid.selector.whereClause = this.selectorGrid.selector.whereClause + " and " + data.filterExpression;
+      } else {
+        this.selectorGrid.selector.whereClause = data.filterExpression;
+      }
+      delete data.filterExpression;
+    }
+
     // draw now already otherwise the filter does not work the
     // first time
     this.selectorWindow.show();
@@ -593,7 +603,12 @@
   // form, suggestion box and popup modal and grid components.
   initWidget: function () {
 
-    var baseTestRegistryName = 'org.openbravo.userinterface.selector.' + this.openbravoField + '.';
+    var baseTestRegistryName = 'org.openbravo.userinterface.selector.' + this.openbravoField + '.',
+        initialValueMap = {};
+
+    if (this.openbravoField.value) {
+      initialValueMap[this.openbravoField.value] = this.openbravoField.getAttribute('identifier');
+    }
 
     // Do not destroy dataSource after creation
     // https://issues.openbravo.com/view.php?id=18456
@@ -616,8 +631,7 @@
       shouldSaveValue: false,
       validateOnChange: true,
       completeOnTab: true,
-
-      valueMap: {},
+      valueMap: initialValueMap,
       icons: [{
         selector: this,
         showFocused: true,
@@ -774,6 +788,7 @@
     } else {
       this.selectorField.textBoxStyle = isc.OBSelectorWidget.styling.selectorFieldTextBoxStyle;
     }
+
     this.selectorField.setValue(this.openbravoField.value);
     this.initialValue = this.selectorField.getValue();
 
--- a/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -6,7 +6,7 @@
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <NAME><![CDATA[2.50 to 3.00 Compatibility Skin]]></NAME>
-<!--96998CBC42744B3DBEE28AC8095C9335-->  <VERSION><![CDATA[2.0.18210]]></VERSION>
+<!--96998CBC42744B3DBEE28AC8095C9335-->  <VERSION><![CDATA[2.0.18279]]></VERSION>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <DESCRIPTION><![CDATA[Skin module to proper visualization of classic windows inside the MDI interface]]></DESCRIPTION>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <HELP><![CDATA[With this skin module the classic windows styles will display in a way more coherent with the new 3.00 styles]]></HELP>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <URL><![CDATA[www.openbravo.com]]></URL>
--- a/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -7,7 +7,7 @@
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <AD_MODULE_ID><![CDATA[96998CBC42744B3DBEE28AC8095C9335]]></AD_MODULE_ID>
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--39BF75AD9AB3453698BF5DE29E727AA9-->  <STARTVERSION><![CDATA[3.0.18210]]></STARTVERSION>
+<!--39BF75AD9AB3453698BF5DE29E727AA9-->  <STARTVERSION><![CDATA[3.0.18279]]></STARTVERSION>
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MESSAGE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MESSAGE.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,5 +1,16 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <data>
+<!--03EFA0B843B84CCC86DA958ECAA3B074--><AD_MESSAGE>
+<!--03EFA0B843B84CCC86DA958ECAA3B074-->  <AD_MESSAGE_ID><![CDATA[03EFA0B843B84CCC86DA958ECAA3B074]]></AD_MESSAGE_ID>
+<!--03EFA0B843B84CCC86DA958ECAA3B074-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--03EFA0B843B84CCC86DA958ECAA3B074-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--03EFA0B843B84CCC86DA958ECAA3B074-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--03EFA0B843B84CCC86DA958ECAA3B074-->  <VALUE><![CDATA[OBUISC_GroupingMessages.upcomingBeforeTitle]]></VALUE>
+<!--03EFA0B843B84CCC86DA958ECAA3B074-->  <MSGTEXT><![CDATA[Before]]></MSGTEXT>
+<!--03EFA0B843B84CCC86DA958ECAA3B074-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--03EFA0B843B84CCC86DA958ECAA3B074-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--03EFA0B843B84CCC86DA958ECAA3B074--></AD_MESSAGE>
+
 <!--073D44494805431ABF02F2A4F997979F--><AD_MESSAGE>
 <!--073D44494805431ABF02F2A4F997979F-->  <AD_MESSAGE_ID><![CDATA[073D44494805431ABF02F2A4F997979F]]></AD_MESSAGE_ID>
 <!--073D44494805431ABF02F2A4F997979F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -55,6 +66,61 @@
 <!--0B2FA3A470744479A088E7B65D96B802-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--0B2FA3A470744479A088E7B65D96B802--></AD_MESSAGE>
 
+<!--0BE034AE15D545B7AD5164A3F6988305--><AD_MESSAGE>
+<!--0BE034AE15D545B7AD5164A3F6988305-->  <AD_MESSAGE_ID><![CDATA[0BE034AE15D545B7AD5164A3F6988305]]></AD_MESSAGE_ID>
+<!--0BE034AE15D545B7AD5164A3F6988305-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--0BE034AE15D545B7AD5164A3F6988305-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--0BE034AE15D545B7AD5164A3F6988305-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--0BE034AE15D545B7AD5164A3F6988305-->  <VALUE><![CDATA[OBUISC_GroupingMessages.byUpcomingTitle]]></VALUE>
+<!--0BE034AE15D545B7AD5164A3F6988305-->  <MSGTEXT><![CDATA[By Upcoming Period]]></MSGTEXT>
+<!--0BE034AE15D545B7AD5164A3F6988305-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--0BE034AE15D545B7AD5164A3F6988305-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--0BE034AE15D545B7AD5164A3F6988305--></AD_MESSAGE>
+
+<!--19875CFF6B6B4D6B8D06FE1EF0313139--><AD_MESSAGE>
+<!--19875CFF6B6B4D6B8D06FE1EF0313139-->  <AD_MESSAGE_ID><![CDATA[19875CFF6B6B4D6B8D06FE1EF0313139]]></AD_MESSAGE_ID>
+<!--19875CFF6B6B4D6B8D06FE1EF0313139-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--19875CFF6B6B4D6B8D06FE1EF0313139-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--19875CFF6B6B4D6B8D06FE1EF0313139-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--19875CFF6B6B4D6B8D06FE1EF0313139-->  <VALUE><![CDATA[OBUISC_GroupingMessages.upcomingNextWeekTitle]]></VALUE>
+<!--19875CFF6B6B4D6B8D06FE1EF0313139-->  <MSGTEXT><![CDATA[Upcoming next Week]]></MSGTEXT>
+<!--19875CFF6B6B4D6B8D06FE1EF0313139-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--19875CFF6B6B4D6B8D06FE1EF0313139-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--19875CFF6B6B4D6B8D06FE1EF0313139--></AD_MESSAGE>
+
+<!--21D38AD3FFC44BC8910F8A185D6626BF--><AD_MESSAGE>
+<!--21D38AD3FFC44BC8910F8A185D6626BF-->  <AD_MESSAGE_ID><![CDATA[21D38AD3FFC44BC8910F8A185D6626BF]]></AD_MESSAGE_ID>
+<!--21D38AD3FFC44BC8910F8A185D6626BF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--21D38AD3FFC44BC8910F8A185D6626BF-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--21D38AD3FFC44BC8910F8A185D6626BF-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--21D38AD3FFC44BC8910F8A185D6626BF-->  <VALUE><![CDATA[OBUISC_GroupingMessages.bySecondsTitle]]></VALUE>
+<!--21D38AD3FFC44BC8910F8A185D6626BF-->  <MSGTEXT><![CDATA[By Seconds]]></MSGTEXT>
+<!--21D38AD3FFC44BC8910F8A185D6626BF-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--21D38AD3FFC44BC8910F8A185D6626BF-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--21D38AD3FFC44BC8910F8A185D6626BF--></AD_MESSAGE>
+
+<!--27C5BABA1E2944CC859DC6ADAB508293--><AD_MESSAGE>
+<!--27C5BABA1E2944CC859DC6ADAB508293-->  <AD_MESSAGE_ID><![CDATA[27C5BABA1E2944CC859DC6ADAB508293]]></AD_MESSAGE_ID>
+<!--27C5BABA1E2944CC859DC6ADAB508293-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--27C5BABA1E2944CC859DC6ADAB508293-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--27C5BABA1E2944CC859DC6ADAB508293-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--27C5BABA1E2944CC859DC6ADAB508293-->  <VALUE><![CDATA[OBUISC_GroupingMessages.upcomingLaterTitle]]></VALUE>
+<!--27C5BABA1E2944CC859DC6ADAB508293-->  <MSGTEXT><![CDATA[Upcoming Later]]></MSGTEXT>
+<!--27C5BABA1E2944CC859DC6ADAB508293-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--27C5BABA1E2944CC859DC6ADAB508293-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--27C5BABA1E2944CC859DC6ADAB508293--></AD_MESSAGE>
+
+<!--2ADA167E2D0C4DC2A0A357B19FC0ED78--><AD_MESSAGE>
+<!--2ADA167E2D0C4DC2A0A357B19FC0ED78-->  <AD_MESSAGE_ID><![CDATA[2ADA167E2D0C4DC2A0A357B19FC0ED78]]></AD_MESSAGE_ID>
+<!--2ADA167E2D0C4DC2A0A357B19FC0ED78-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2ADA167E2D0C4DC2A0A357B19FC0ED78-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2ADA167E2D0C4DC2A0A357B19FC0ED78-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2ADA167E2D0C4DC2A0A357B19FC0ED78-->  <VALUE><![CDATA[OBUISC_GroupingMessages.upcomingTomorrowTitle]]></VALUE>
+<!--2ADA167E2D0C4DC2A0A357B19FC0ED78-->  <MSGTEXT><![CDATA[Upcoming Tomorrow]]></MSGTEXT>
+<!--2ADA167E2D0C4DC2A0A357B19FC0ED78-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--2ADA167E2D0C4DC2A0A357B19FC0ED78-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--2ADA167E2D0C4DC2A0A357B19FC0ED78--></AD_MESSAGE>
+
 <!--36ECA3AA04F546359EB9AEA67C8D16EF--><AD_MESSAGE>
 <!--36ECA3AA04F546359EB9AEA67C8D16EF-->  <AD_MESSAGE_ID><![CDATA[36ECA3AA04F546359EB9AEA67C8D16EF]]></AD_MESSAGE_ID>
 <!--36ECA3AA04F546359EB9AEA67C8D16EF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -209,6 +275,17 @@
 <!--5A5DC8F15AB14E7B9043E936E5241E03-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--5A5DC8F15AB14E7B9043E936E5241E03--></AD_MESSAGE>
 
+<!--5AB1CFD1DB644950A7F157FB1B9B25E7--><AD_MESSAGE>
+<!--5AB1CFD1DB644950A7F157FB1B9B25E7-->  <AD_MESSAGE_ID><![CDATA[5AB1CFD1DB644950A7F157FB1B9B25E7]]></AD_MESSAGE_ID>
+<!--5AB1CFD1DB644950A7F157FB1B9B25E7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--5AB1CFD1DB644950A7F157FB1B9B25E7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--5AB1CFD1DB644950A7F157FB1B9B25E7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--5AB1CFD1DB644950A7F157FB1B9B25E7-->  <VALUE><![CDATA[OBUISC_GroupingMessages.byYearTitle]]></VALUE>
+<!--5AB1CFD1DB644950A7F157FB1B9B25E7-->  <MSGTEXT><![CDATA[By Year]]></MSGTEXT>
+<!--5AB1CFD1DB644950A7F157FB1B9B25E7-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--5AB1CFD1DB644950A7F157FB1B9B25E7-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--5AB1CFD1DB644950A7F157FB1B9B25E7--></AD_MESSAGE>
+
 <!--5F8C24DC3EFF41A7ABDBDB405C551A30--><AD_MESSAGE>
 <!--5F8C24DC3EFF41A7ABDBDB405C551A30-->  <AD_MESSAGE_ID><![CDATA[5F8C24DC3EFF41A7ABDBDB405C551A30]]></AD_MESSAGE_ID>
 <!--5F8C24DC3EFF41A7ABDBDB405C551A30-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -319,6 +396,17 @@
 <!--7567EB9676974F80977EE14F36D061EA-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--7567EB9676974F80977EE14F36D061EA--></AD_MESSAGE>
 
+<!--75AD1BEDFB5742329794D1CF5FA2BEA5--><AD_MESSAGE>
+<!--75AD1BEDFB5742329794D1CF5FA2BEA5-->  <AD_MESSAGE_ID><![CDATA[75AD1BEDFB5742329794D1CF5FA2BEA5]]></AD_MESSAGE_ID>
+<!--75AD1BEDFB5742329794D1CF5FA2BEA5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--75AD1BEDFB5742329794D1CF5FA2BEA5-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--75AD1BEDFB5742329794D1CF5FA2BEA5-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--75AD1BEDFB5742329794D1CF5FA2BEA5-->  <VALUE><![CDATA[OBUISC_GroupingMessages.upcomingNextMonthTitle]]></VALUE>
+<!--75AD1BEDFB5742329794D1CF5FA2BEA5-->  <MSGTEXT><![CDATA[Upcoming next Month]]></MSGTEXT>
+<!--75AD1BEDFB5742329794D1CF5FA2BEA5-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--75AD1BEDFB5742329794D1CF5FA2BEA5-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--75AD1BEDFB5742329794D1CF5FA2BEA5--></AD_MESSAGE>
+
 <!--77ECA856B3E446AA8C72F980E613187A--><AD_MESSAGE>
 <!--77ECA856B3E446AA8C72F980E613187A-->  <AD_MESSAGE_ID><![CDATA[77ECA856B3E446AA8C72F980E613187A]]></AD_MESSAGE_ID>
 <!--77ECA856B3E446AA8C72F980E613187A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -330,6 +418,17 @@
 <!--77ECA856B3E446AA8C72F980E613187A-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--77ECA856B3E446AA8C72F980E613187A--></AD_MESSAGE>
 
+<!--7C15B69483EE464F9946975BD6585790--><AD_MESSAGE>
+<!--7C15B69483EE464F9946975BD6585790-->  <AD_MESSAGE_ID><![CDATA[7C15B69483EE464F9946975BD6585790]]></AD_MESSAGE_ID>
+<!--7C15B69483EE464F9946975BD6585790-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7C15B69483EE464F9946975BD6585790-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7C15B69483EE464F9946975BD6585790-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7C15B69483EE464F9946975BD6585790-->  <VALUE><![CDATA[OBUISC_GroupingMessages.upcomingTodayTitle]]></VALUE>
+<!--7C15B69483EE464F9946975BD6585790-->  <MSGTEXT><![CDATA[Upcoming Day]]></MSGTEXT>
+<!--7C15B69483EE464F9946975BD6585790-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--7C15B69483EE464F9946975BD6585790-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--7C15B69483EE464F9946975BD6585790--></AD_MESSAGE>
+
 <!--802BE9DC8B3A48CC9207CD9A8E8D1134--><AD_MESSAGE>
 <!--802BE9DC8B3A48CC9207CD9A8E8D1134-->  <AD_MESSAGE_ID><![CDATA[802BE9DC8B3A48CC9207CD9A8E8D1134]]></AD_MESSAGE_ID>
 <!--802BE9DC8B3A48CC9207CD9A8E8D1134-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -396,6 +495,17 @@
 <!--9627AEA9DE6E4197B5DF00E5591E0B8E-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--9627AEA9DE6E4197B5DF00E5591E0B8E--></AD_MESSAGE>
 
+<!--97A7B1C1B6B24862B2F52C47959E29CE--><AD_MESSAGE>
+<!--97A7B1C1B6B24862B2F52C47959E29CE-->  <AD_MESSAGE_ID><![CDATA[97A7B1C1B6B24862B2F52C47959E29CE]]></AD_MESSAGE_ID>
+<!--97A7B1C1B6B24862B2F52C47959E29CE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--97A7B1C1B6B24862B2F52C47959E29CE-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--97A7B1C1B6B24862B2F52C47959E29CE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--97A7B1C1B6B24862B2F52C47959E29CE-->  <VALUE><![CDATA[OBUISC_GroupingMessages.byHoursTitle]]></VALUE>
+<!--97A7B1C1B6B24862B2F52C47959E29CE-->  <MSGTEXT><![CDATA[By Hours]]></MSGTEXT>
+<!--97A7B1C1B6B24862B2F52C47959E29CE-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--97A7B1C1B6B24862B2F52C47959E29CE-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--97A7B1C1B6B24862B2F52C47959E29CE--></AD_MESSAGE>
+
 <!--AD5A49B6CAF340509FDB782B17691BAD--><AD_MESSAGE>
 <!--AD5A49B6CAF340509FDB782B17691BAD-->  <AD_MESSAGE_ID><![CDATA[AD5A49B6CAF340509FDB782B17691BAD]]></AD_MESSAGE_ID>
 <!--AD5A49B6CAF340509FDB782B17691BAD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -418,6 +528,17 @@
 <!--ADFB5D7447B94191B8D0C7523382CFB7-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--ADFB5D7447B94191B8D0C7523382CFB7--></AD_MESSAGE>
 
+<!--B31B14F792BC4012992C7710CAC48BC9--><AD_MESSAGE>
+<!--B31B14F792BC4012992C7710CAC48BC9-->  <AD_MESSAGE_ID><![CDATA[B31B14F792BC4012992C7710CAC48BC9]]></AD_MESSAGE_ID>
+<!--B31B14F792BC4012992C7710CAC48BC9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B31B14F792BC4012992C7710CAC48BC9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B31B14F792BC4012992C7710CAC48BC9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B31B14F792BC4012992C7710CAC48BC9-->  <VALUE><![CDATA[OBUISC_GroupingMessages.byQuarterTitle]]></VALUE>
+<!--B31B14F792BC4012992C7710CAC48BC9-->  <MSGTEXT><![CDATA[By Quarter]]></MSGTEXT>
+<!--B31B14F792BC4012992C7710CAC48BC9-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--B31B14F792BC4012992C7710CAC48BC9-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--B31B14F792BC4012992C7710CAC48BC9--></AD_MESSAGE>
+
 <!--B3ACEF51CF934FE4A155C11F98259059--><AD_MESSAGE>
 <!--B3ACEF51CF934FE4A155C11F98259059-->  <AD_MESSAGE_ID><![CDATA[B3ACEF51CF934FE4A155C11F98259059]]></AD_MESSAGE_ID>
 <!--B3ACEF51CF934FE4A155C11F98259059-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -462,6 +583,28 @@
 <!--BC6E7EFDA7874982A6AC648A5FF3E441-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--BC6E7EFDA7874982A6AC648A5FF3E441--></AD_MESSAGE>
 
+<!--BD46E7BB97844F359BEFAF87DA6B18C6--><AD_MESSAGE>
+<!--BD46E7BB97844F359BEFAF87DA6B18C6-->  <AD_MESSAGE_ID><![CDATA[BD46E7BB97844F359BEFAF87DA6B18C6]]></AD_MESSAGE_ID>
+<!--BD46E7BB97844F359BEFAF87DA6B18C6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--BD46E7BB97844F359BEFAF87DA6B18C6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--BD46E7BB97844F359BEFAF87DA6B18C6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--BD46E7BB97844F359BEFAF87DA6B18C6-->  <VALUE><![CDATA[OBUISC_GroupingMessages.byDayTitle]]></VALUE>
+<!--BD46E7BB97844F359BEFAF87DA6B18C6-->  <MSGTEXT><![CDATA[By Day]]></MSGTEXT>
+<!--BD46E7BB97844F359BEFAF87DA6B18C6-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--BD46E7BB97844F359BEFAF87DA6B18C6-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--BD46E7BB97844F359BEFAF87DA6B18C6--></AD_MESSAGE>
+
+<!--C00CE5F42AE3497CB01131E43D67BFD6--><AD_MESSAGE>
+<!--C00CE5F42AE3497CB01131E43D67BFD6-->  <AD_MESSAGE_ID><![CDATA[C00CE5F42AE3497CB01131E43D67BFD6]]></AD_MESSAGE_ID>
+<!--C00CE5F42AE3497CB01131E43D67BFD6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C00CE5F42AE3497CB01131E43D67BFD6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C00CE5F42AE3497CB01131E43D67BFD6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C00CE5F42AE3497CB01131E43D67BFD6-->  <VALUE><![CDATA[OBUISC_GroupingMessages.byDayOfMonthTitle]]></VALUE>
+<!--C00CE5F42AE3497CB01131E43D67BFD6-->  <MSGTEXT><![CDATA[By Day of Month]]></MSGTEXT>
+<!--C00CE5F42AE3497CB01131E43D67BFD6-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--C00CE5F42AE3497CB01131E43D67BFD6-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--C00CE5F42AE3497CB01131E43D67BFD6--></AD_MESSAGE>
+
 <!--C7B99E0D8B6C4312AF378E9A6AEEF402--><AD_MESSAGE>
 <!--C7B99E0D8B6C4312AF378E9A6AEEF402-->  <AD_MESSAGE_ID><![CDATA[C7B99E0D8B6C4312AF378E9A6AEEF402]]></AD_MESSAGE_ID>
 <!--C7B99E0D8B6C4312AF378E9A6AEEF402-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -506,6 +649,17 @@
 <!--D0FBC82DC0C0440184A5083DB0282DCA-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--D0FBC82DC0C0440184A5083DB0282DCA--></AD_MESSAGE>
 
+<!--D13053ADB49C4E5E8FC33DCD317AFB5F--><AD_MESSAGE>
+<!--D13053ADB49C4E5E8FC33DCD317AFB5F-->  <AD_MESSAGE_ID><![CDATA[D13053ADB49C4E5E8FC33DCD317AFB5F]]></AD_MESSAGE_ID>
+<!--D13053ADB49C4E5E8FC33DCD317AFB5F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D13053ADB49C4E5E8FC33DCD317AFB5F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D13053ADB49C4E5E8FC33DCD317AFB5F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D13053ADB49C4E5E8FC33DCD317AFB5F-->  <VALUE><![CDATA[OBUISC_GroupingMessages.byMinutesTitle]]></VALUE>
+<!--D13053ADB49C4E5E8FC33DCD317AFB5F-->  <MSGTEXT><![CDATA[By Minutes]]></MSGTEXT>
+<!--D13053ADB49C4E5E8FC33DCD317AFB5F-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--D13053ADB49C4E5E8FC33DCD317AFB5F-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--D13053ADB49C4E5E8FC33DCD317AFB5F--></AD_MESSAGE>
+
 <!--D1C66ECA6F9D4478B998DD861E36EE8E--><AD_MESSAGE>
 <!--D1C66ECA6F9D4478B998DD861E36EE8E-->  <AD_MESSAGE_ID><![CDATA[D1C66ECA6F9D4478B998DD861E36EE8E]]></AD_MESSAGE_ID>
 <!--D1C66ECA6F9D4478B998DD861E36EE8E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -528,6 +682,17 @@
 <!--D1CF7A1BF1CF4F6690E4441FD55A4EC8-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--D1CF7A1BF1CF4F6690E4441FD55A4EC8--></AD_MESSAGE>
 
+<!--D350B5F3693F4481B152739B2C8352F0--><AD_MESSAGE>
+<!--D350B5F3693F4481B152739B2C8352F0-->  <AD_MESSAGE_ID><![CDATA[D350B5F3693F4481B152739B2C8352F0]]></AD_MESSAGE_ID>
+<!--D350B5F3693F4481B152739B2C8352F0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D350B5F3693F4481B152739B2C8352F0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D350B5F3693F4481B152739B2C8352F0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D350B5F3693F4481B152739B2C8352F0-->  <VALUE><![CDATA[OBUISC_GroupingMessages.byWeekTitle]]></VALUE>
+<!--D350B5F3693F4481B152739B2C8352F0-->  <MSGTEXT><![CDATA[By Week]]></MSGTEXT>
+<!--D350B5F3693F4481B152739B2C8352F0-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--D350B5F3693F4481B152739B2C8352F0-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--D350B5F3693F4481B152739B2C8352F0--></AD_MESSAGE>
+
 <!--D50AFA642836488C83B9B876F499FE82--><AD_MESSAGE>
 <!--D50AFA642836488C83B9B876F499FE82-->  <AD_MESSAGE_ID><![CDATA[D50AFA642836488C83B9B876F499FE82]]></AD_MESSAGE_ID>
 <!--D50AFA642836488C83B9B876F499FE82-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -572,6 +737,17 @@
 <!--D9055AD1F1034064AE5FFA7272072A39-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--D9055AD1F1034064AE5FFA7272072A39--></AD_MESSAGE>
 
+<!--DBEEBCB652484D8CADE5D5231E345E68--><AD_MESSAGE>
+<!--DBEEBCB652484D8CADE5D5231E345E68-->  <AD_MESSAGE_ID><![CDATA[DBEEBCB652484D8CADE5D5231E345E68]]></AD_MESSAGE_ID>
+<!--DBEEBCB652484D8CADE5D5231E345E68-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--DBEEBCB652484D8CADE5D5231E345E68-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--DBEEBCB652484D8CADE5D5231E345E68-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--DBEEBCB652484D8CADE5D5231E345E68-->  <VALUE><![CDATA[OBUISC_GroupingMessages.byMilisecondsTitle]]></VALUE>
+<!--DBEEBCB652484D8CADE5D5231E345E68-->  <MSGTEXT><![CDATA[By Milliseconds]]></MSGTEXT>
+<!--DBEEBCB652484D8CADE5D5231E345E68-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--DBEEBCB652484D8CADE5D5231E345E68-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--DBEEBCB652484D8CADE5D5231E345E68--></AD_MESSAGE>
+
 <!--E93E72E829124C699B64401EEA1F4884--><AD_MESSAGE>
 <!--E93E72E829124C699B64401EEA1F4884-->  <AD_MESSAGE_ID><![CDATA[E93E72E829124C699B64401EEA1F4884]]></AD_MESSAGE_ID>
 <!--E93E72E829124C699B64401EEA1F4884-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -583,6 +759,28 @@
 <!--E93E72E829124C699B64401EEA1F4884-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--E93E72E829124C699B64401EEA1F4884--></AD_MESSAGE>
 
+<!--EFBFFE22B06E45F4A02843C135971358--><AD_MESSAGE>
+<!--EFBFFE22B06E45F4A02843C135971358-->  <AD_MESSAGE_ID><![CDATA[EFBFFE22B06E45F4A02843C135971358]]></AD_MESSAGE_ID>
+<!--EFBFFE22B06E45F4A02843C135971358-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--EFBFFE22B06E45F4A02843C135971358-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--EFBFFE22B06E45F4A02843C135971358-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--EFBFFE22B06E45F4A02843C135971358-->  <VALUE><![CDATA[OBUISC_GroupingMessages.byMonthTitle]]></VALUE>
+<!--EFBFFE22B06E45F4A02843C135971358-->  <MSGTEXT><![CDATA[By Month]]></MSGTEXT>
+<!--EFBFFE22B06E45F4A02843C135971358-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--EFBFFE22B06E45F4A02843C135971358-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--EFBFFE22B06E45F4A02843C135971358--></AD_MESSAGE>
+
+<!--F110B5081A7D4544A1FD6A5928EA7D50--><AD_MESSAGE>
+<!--F110B5081A7D4544A1FD6A5928EA7D50-->  <AD_MESSAGE_ID><![CDATA[F110B5081A7D4544A1FD6A5928EA7D50]]></AD_MESSAGE_ID>
+<!--F110B5081A7D4544A1FD6A5928EA7D50-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F110B5081A7D4544A1FD6A5928EA7D50-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F110B5081A7D4544A1FD6A5928EA7D50-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F110B5081A7D4544A1FD6A5928EA7D50-->  <VALUE><![CDATA[OBUISC_GroupingMessages.upcomingThisWeekTitle]]></VALUE>
+<!--F110B5081A7D4544A1FD6A5928EA7D50-->  <MSGTEXT><![CDATA[Upcoming this Week]]></MSGTEXT>
+<!--F110B5081A7D4544A1FD6A5928EA7D50-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--F110B5081A7D4544A1FD6A5928EA7D50-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
+<!--F110B5081A7D4544A1FD6A5928EA7D50--></AD_MESSAGE>
+
 <!--F2F34B0344E549369217D26D33DE3075--><AD_MESSAGE>
 <!--F2F34B0344E549369217D26D33DE3075-->  <AD_MESSAGE_ID><![CDATA[F2F34B0344E549369217D26D33DE3075]]></AD_MESSAGE_ID>
 <!--F2F34B0344E549369217D26D33DE3075-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -6,7 +6,7 @@
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <NAME><![CDATA[Smartclient]]></NAME>
-<!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <VERSION><![CDATA[8.1.18210]]></VERSION>
+<!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <VERSION><![CDATA[8.1.18279]]></VERSION>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <DESCRIPTION><![CDATA[SmartClient libraries for use within Openbravo]]></DESCRIPTION>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <HELP><![CDATA[This module contains the SmartClient libraries for usage by other modules. It also contains some simple test pages to validate that SmartClient is working correctly. Also contains generic Openbravo SmartClient components]]></HELP>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <URL><![CDATA[http://forge.openbravo.com/projects/obsmartclient]]></URL>
--- a/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -7,7 +7,7 @@
 <!--086331E18477496B8AC74D2CFEBD1307-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--086331E18477496B8AC74D2CFEBD1307-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--086331E18477496B8AC74D2CFEBD1307-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--086331E18477496B8AC74D2CFEBD1307-->  <STARTVERSION><![CDATA[3.0.18210]]></STARTVERSION>
+<!--086331E18477496B8AC74D2CFEBD1307-->  <STARTVERSION><![CDATA[3.0.18279]]></STARTVERSION>
 <!--086331E18477496B8AC74D2CFEBD1307-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--086331E18477496B8AC74D2CFEBD1307-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--086331E18477496B8AC74D2CFEBD1307-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--DC5D4EF450244482BD2B458DAA496333-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--DC5D4EF450244482BD2B458DAA496333-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--DC5D4EF450244482BD2B458DAA496333-->  <AD_DEPENDENT_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_DEPENDENT_MODULE_ID>
-<!--DC5D4EF450244482BD2B458DAA496333-->  <STARTVERSION><![CDATA[2.1.18210]]></STARTVERSION>
+<!--DC5D4EF450244482BD2B458DAA496333-->  <STARTVERSION><![CDATA[2.1.18279]]></STARTVERSION>
 <!--DC5D4EF450244482BD2B458DAA496333-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--DC5D4EF450244482BD2B458DAA496333-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Client Kernel]]></DEPENDANT_MODULE_NAME>
 <!--DC5D4EF450244482BD2B458DAA496333-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <AD_DEPENDENT_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_DEPENDENT_MODULE_ID>
-<!--F2AF15C0AF5540E393D96BE506E20648-->  <STARTVERSION><![CDATA[1.1.18210]]></STARTVERSION>
+<!--F2AF15C0AF5540E393D96BE506E20648-->  <STARTVERSION><![CDATA[1.1.18279]]></STARTVERSION>
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <DEPENDANT_MODULE_NAME><![CDATA[JBoss Weld]]></DEPENDANT_MODULE_NAME>
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -6,7 +6,7 @@
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <NAME><![CDATA[Standard Roles]]></NAME>
-<!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <VERSION><![CDATA[3.0.18210]]></VERSION>
+<!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <VERSION><![CDATA[3.0.18279]]></VERSION>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <DESCRIPTION><![CDATA[Pre-configured collection of standard ERP roles]]></DESCRIPTION>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <HELP><![CDATA[This dataset contains the following roles with their access to corresponding Openbravo entities - windows, reports, actions.
 * Employee - Any person of the enterprise
--- a/modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -7,7 +7,7 @@
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <AD_MODULE_ID><![CDATA[883B5872CA0548F9AF2BBBE7D2DDFA61]]></AD_MODULE_ID>
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--148A000EE9A04A3CA653B1296A00B8E6-->  <STARTVERSION><![CDATA[3.0.18210]]></STARTVERSION>
+<!--148A000EE9A04A3CA653B1296A00B8E6-->  <STARTVERSION><![CDATA[3.0.18279]]></STARTVERSION>
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--30F966407A6F4E15965821BAEE34D25B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--30F966407A6F4E15965821BAEE34D25B-->  <AD_MODULE_ID><![CDATA[883B5872CA0548F9AF2BBBE7D2DDFA61]]></AD_MODULE_ID>
 <!--30F966407A6F4E15965821BAEE34D25B-->  <AD_DEPENDENT_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_DEPENDENT_MODULE_ID>
-<!--30F966407A6F4E15965821BAEE34D25B-->  <STARTVERSION><![CDATA[3.0.18210]]></STARTVERSION>
+<!--30F966407A6F4E15965821BAEE34D25B-->  <STARTVERSION><![CDATA[3.0.18279]]></STARTVERSION>
 <!--30F966407A6F4E15965821BAEE34D25B-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--30F966407A6F4E15965821BAEE34D25B-->  <DEPENDANT_MODULE_NAME><![CDATA[Advanced Payables and Receivables Mngmt]]></DEPENDANT_MODULE_NAME>
 <!--30F966407A6F4E15965821BAEE34D25B-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--F93CE30003B24F8F8886510B0065EECC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--F93CE30003B24F8F8886510B0065EECC-->  <AD_MODULE_ID><![CDATA[883B5872CA0548F9AF2BBBE7D2DDFA61]]></AD_MODULE_ID>
 <!--F93CE30003B24F8F8886510B0065EECC-->  <AD_DEPENDENT_MODULE_ID><![CDATA[3A3A943684D64DEF9EC39F588A656848]]></AD_DEPENDENT_MODULE_ID>
-<!--F93CE30003B24F8F8886510B0065EECC-->  <STARTVERSION><![CDATA[1.1.18210]]></STARTVERSION>
+<!--F93CE30003B24F8F8886510B0065EECC-->  <STARTVERSION><![CDATA[1.1.18279]]></STARTVERSION>
 <!--F93CE30003B24F8F8886510B0065EECC-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--F93CE30003B24F8F8886510B0065EECC-->  <DEPENDANT_MODULE_NAME><![CDATA[Orders Awaiting Delivery]]></DEPENDANT_MODULE_NAME>
 <!--F93CE30003B24F8F8886510B0065EECC-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -6,7 +6,7 @@
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <NAME><![CDATA[Openbravo 3.0 Framework]]></NAME>
-<!--7E48CDD73B7E493A8BED4F7253E7C989-->  <VERSION><![CDATA[2.1.18210]]></VERSION>
+<!--7E48CDD73B7E493A8BED4F7253E7C989-->  <VERSION><![CDATA[2.1.18279]]></VERSION>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <DESCRIPTION><![CDATA[Openbravo 3.0 Framework]]></DESCRIPTION>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <HELP><![CDATA[Contains all the components required to run the Openbravo 3.0 framework]]></HELP>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <URL><![CDATA[http://forge.openbravo.com/projects/openbravov30framework]]></URL>
--- a/modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -7,7 +7,7 @@
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <AD_DEPENDENT_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_DEPENDENT_MODULE_ID>
-<!--01E1BCCEC9114DE0960538DF34E30E6F-->  <STARTVERSION><![CDATA[2.1.18210]]></STARTVERSION>
+<!--01E1BCCEC9114DE0960538DF34E30E6F-->  <STARTVERSION><![CDATA[2.1.18279]]></STARTVERSION>
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <DEPENDANT_MODULE_NAME><![CDATA[My Openbravo Tab]]></DEPENDANT_MODULE_NAME>
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--025B181F63CA47B48A920F6983242390-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--025B181F63CA47B48A920F6983242390-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--025B181F63CA47B48A920F6983242390-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--025B181F63CA47B48A920F6983242390-->  <STARTVERSION><![CDATA[3.0.18210]]></STARTVERSION>
+<!--025B181F63CA47B48A920F6983242390-->  <STARTVERSION><![CDATA[3.0.18279]]></STARTVERSION>
 <!--025B181F63CA47B48A920F6983242390-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--025B181F63CA47B48A920F6983242390-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--025B181F63CA47B48A920F6983242390-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <AD_DEPENDENT_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_DEPENDENT_MODULE_ID>
-<!--054B4FEAF919478AA3FF27098A46D1D6-->  <STARTVERSION><![CDATA[2.1.18210]]></STARTVERSION>
+<!--054B4FEAF919478AA3FF27098A46D1D6-->  <STARTVERSION><![CDATA[2.1.18279]]></STARTVERSION>
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Application]]></DEPENDANT_MODULE_NAME>
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -49,7 +49,7 @@
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_DEPENDENT_MODULE_ID>
-<!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <STARTVERSION><![CDATA[1.0.18210]]></STARTVERSION>
+<!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <STARTVERSION><![CDATA[1.0.18279]]></STARTVERSION>
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <DEPENDANT_MODULE_NAME><![CDATA[Query/List Widget]]></DEPENDANT_MODULE_NAME>
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -63,7 +63,7 @@
 <!--224754C3EF674C93B0D468F47BAAB824-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--224754C3EF674C93B0D468F47BAAB824-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--224754C3EF674C93B0D468F47BAAB824-->  <AD_DEPENDENT_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_DEPENDENT_MODULE_ID>
-<!--224754C3EF674C93B0D468F47BAAB824-->  <STARTVERSION><![CDATA[2.1.18210]]></STARTVERSION>
+<!--224754C3EF674C93B0D468F47BAAB824-->  <STARTVERSION><![CDATA[2.1.18279]]></STARTVERSION>
 <!--224754C3EF674C93B0D468F47BAAB824-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--224754C3EF674C93B0D468F47BAAB824-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Selector]]></DEPENDANT_MODULE_NAME>
 <!--224754C3EF674C93B0D468F47BAAB824-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -77,7 +77,7 @@
 <!--5B72D24032DD4879A950194139D961B6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--5B72D24032DD4879A950194139D961B6-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--5B72D24032DD4879A950194139D961B6-->  <AD_DEPENDENT_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_DEPENDENT_MODULE_ID>
-<!--5B72D24032DD4879A950194139D961B6-->  <STARTVERSION><![CDATA[2.1.18210]]></STARTVERSION>
+<!--5B72D24032DD4879A950194139D961B6-->  <STARTVERSION><![CDATA[2.1.18279]]></STARTVERSION>
 <!--5B72D24032DD4879A950194139D961B6-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--5B72D24032DD4879A950194139D961B6-->  <DEPENDANT_MODULE_NAME><![CDATA[JSON Datasource]]></DEPENDANT_MODULE_NAME>
 <!--5B72D24032DD4879A950194139D961B6-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -91,7 +91,7 @@
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <AD_DEPENDENT_MODULE_ID><![CDATA[D393BE6F22BB44B7B728259B34FC795A]]></AD_DEPENDENT_MODULE_ID>
-<!--8730CA6A4224439D82E0DD31B3806E36-->  <STARTVERSION><![CDATA[1.0.18210]]></STARTVERSION>
+<!--8730CA6A4224439D82E0DD31B3806E36-->  <STARTVERSION><![CDATA[1.0.18279]]></STARTVERSION>
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <DEPENDANT_MODULE_NAME><![CDATA[HTML Widget]]></DEPENDANT_MODULE_NAME>
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -105,7 +105,7 @@
 <!--98C47FF058F8413B8A2B26036061446E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--98C47FF058F8413B8A2B26036061446E-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--98C47FF058F8413B8A2B26036061446E-->  <AD_DEPENDENT_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_DEPENDENT_MODULE_ID>
-<!--98C47FF058F8413B8A2B26036061446E-->  <STARTVERSION><![CDATA[8.1.18210]]></STARTVERSION>
+<!--98C47FF058F8413B8A2B26036061446E-->  <STARTVERSION><![CDATA[8.1.18279]]></STARTVERSION>
 <!--98C47FF058F8413B8A2B26036061446E-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--98C47FF058F8413B8A2B26036061446E-->  <DEPENDANT_MODULE_NAME><![CDATA[Smartclient]]></DEPENDANT_MODULE_NAME>
 <!--98C47FF058F8413B8A2B26036061446E-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -119,7 +119,7 @@
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <AD_DEPENDENT_MODULE_ID><![CDATA[96998CBC42744B3DBEE28AC8095C9335]]></AD_DEPENDENT_MODULE_ID>
-<!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <STARTVERSION><![CDATA[2.0.18210]]></STARTVERSION>
+<!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <STARTVERSION><![CDATA[2.0.18279]]></STARTVERSION>
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <DEPENDANT_MODULE_NAME><![CDATA[2.50 to 3.00 Compatibility Skin]]></DEPENDANT_MODULE_NAME>
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -133,7 +133,7 @@
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <AD_DEPENDENT_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_DEPENDENT_MODULE_ID>
-<!--A9CB99330AF34944877F889DD8A0AB3C-->  <STARTVERSION><![CDATA[2.1.18210]]></STARTVERSION>
+<!--A9CB99330AF34944877F889DD8A0AB3C-->  <STARTVERSION><![CDATA[2.1.18279]]></STARTVERSION>
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Client Kernel]]></DEPENDANT_MODULE_NAME>
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -147,7 +147,7 @@
 <!--E72A053A403C4A98A189C105B850ADB0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--E72A053A403C4A98A189C105B850ADB0-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--E72A053A403C4A98A189C105B850ADB0-->  <AD_DEPENDENT_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_DEPENDENT_MODULE_ID>
-<!--E72A053A403C4A98A189C105B850ADB0-->  <STARTVERSION><![CDATA[1.1.18210]]></STARTVERSION>
+<!--E72A053A403C4A98A189C105B850ADB0-->  <STARTVERSION><![CDATA[1.1.18279]]></STARTVERSION>
 <!--E72A053A403C4A98A189C105B850ADB0-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--E72A053A403C4A98A189C105B850ADB0-->  <DEPENDANT_MODULE_NAME><![CDATA[JBoss Weld]]></DEPENDANT_MODULE_NAME>
 <!--E72A053A403C4A98A189C105B850ADB0-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -161,7 +161,7 @@
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <AD_DEPENDENT_MODULE_ID><![CDATA[F8D1B3ECB3474E8DA5C216473C840DF1]]></AD_DEPENDENT_MODULE_ID>
-<!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <STARTVERSION><![CDATA[2.0.18210]]></STARTVERSION>
+<!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <STARTVERSION><![CDATA[2.0.18279]]></STARTVERSION>
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <DEPENDANT_MODULE_NAME><![CDATA[JSON REST Webservice]]></DEPENDANT_MODULE_NAME>
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -6,7 +6,7 @@
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <NAME><![CDATA[Openbravo 3.0]]></NAME>
-<!--0138E7A89B5E4DC3932462252801FFBC-->  <VERSION><![CDATA[3.0.18210]]></VERSION>
+<!--0138E7A89B5E4DC3932462252801FFBC-->  <VERSION><![CDATA[3.0.18279]]></VERSION>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <DESCRIPTION><![CDATA[Openbravo 3.0 distribution template]]></DESCRIPTION>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <HELP><![CDATA[Openbravo 3.0 is a collection (distribution) of modules. This template is a container of all the modules and configuration changes that compose Openbravo 3.0.]]></HELP>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <URL><![CDATA[http://forge.openbravo.com/projects/vthree]]></URL>
--- a/modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -7,7 +7,7 @@
 <!--4D11E3A70650475381139522373CD191-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--4D11E3A70650475381139522373CD191-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--4D11E3A70650475381139522373CD191-->  <AD_DEPENDENT_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_DEPENDENT_MODULE_ID>
-<!--4D11E3A70650475381139522373CD191-->  <STARTVERSION><![CDATA[2.1.18210]]></STARTVERSION>
+<!--4D11E3A70650475381139522373CD191-->  <STARTVERSION><![CDATA[2.1.18279]]></STARTVERSION>
 <!--4D11E3A70650475381139522373CD191-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--4D11E3A70650475381139522373CD191-->  <DEPENDANT_MODULE_NAME><![CDATA[Openbravo 3.0 Framework]]></DEPENDANT_MODULE_NAME>
 <!--4D11E3A70650475381139522373CD191-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <AD_DEPENDENT_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_DEPENDENT_MODULE_ID>
-<!--52CE523C40634C47A99C6EBBD9C3125C-->  <STARTVERSION><![CDATA[3.0.18210]]></STARTVERSION>
+<!--52CE523C40634C47A99C6EBBD9C3125C-->  <STARTVERSION><![CDATA[3.0.18279]]></STARTVERSION>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <DEPENDANT_MODULE_NAME><![CDATA[Payment Report]]></DEPENDANT_MODULE_NAME>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--60834727BB114764ACEF019F40A34562-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--60834727BB114764ACEF019F40A34562-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--60834727BB114764ACEF019F40A34562-->  <AD_DEPENDENT_MODULE_ID><![CDATA[3A3A943684D64DEF9EC39F588A656848]]></AD_DEPENDENT_MODULE_ID>
-<!--60834727BB114764ACEF019F40A34562-->  <STARTVERSION><![CDATA[1.1.18210]]></STARTVERSION>
+<!--60834727BB114764ACEF019F40A34562-->  <STARTVERSION><![CDATA[1.1.18279]]></STARTVERSION>
 <!--60834727BB114764ACEF019F40A34562-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--60834727BB114764ACEF019F40A34562-->  <DEPENDANT_MODULE_NAME><![CDATA[Orders Awaiting Delivery]]></DEPENDANT_MODULE_NAME>
 <!--60834727BB114764ACEF019F40A34562-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -49,7 +49,7 @@
 <!--8418885E97D643138B6D907671351E3D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--8418885E97D643138B6D907671351E3D-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--8418885E97D643138B6D907671351E3D-->  <AD_DEPENDENT_MODULE_ID><![CDATA[883B5872CA0548F9AF2BBBE7D2DDFA61]]></AD_DEPENDENT_MODULE_ID>
-<!--8418885E97D643138B6D907671351E3D-->  <STARTVERSION><![CDATA[3.0.18210]]></STARTVERSION>
+<!--8418885E97D643138B6D907671351E3D-->  <STARTVERSION><![CDATA[3.0.18279]]></STARTVERSION>
 <!--8418885E97D643138B6D907671351E3D-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--8418885E97D643138B6D907671351E3D-->  <DEPENDANT_MODULE_NAME><![CDATA[Standard Roles]]></DEPENDANT_MODULE_NAME>
 <!--8418885E97D643138B6D907671351E3D-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -63,7 +63,7 @@
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--A32F3279B3374FC0A6CFEA2368BB7053-->  <STARTVERSION><![CDATA[3.0.18210]]></STARTVERSION>
+<!--A32F3279B3374FC0A6CFEA2368BB7053-->  <STARTVERSION><![CDATA[3.0.18279]]></STARTVERSION>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <DEPENDANT_MODULE_NAME><![CDATA[Core]]></DEPENDANT_MODULE_NAME>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MINOR]]></DEPENDENCY_ENFORCEMENT>
@@ -77,7 +77,7 @@
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <AD_DEPENDENT_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_DEPENDENT_MODULE_ID>
-<!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <STARTVERSION><![CDATA[3.0.18210]]></STARTVERSION>
+<!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <STARTVERSION><![CDATA[3.0.18279]]></STARTVERSION>
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <DEPENDANT_MODULE_NAME><![CDATA[Advanced Payables and Receivables Mngmt]]></DEPENDANT_MODULE_NAME>
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -91,7 +91,7 @@
 <!--FF8080813189932B013189B45B59003A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080813189932B013189B45B59003A-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--FF8080813189932B013189B45B59003A-->  <AD_DEPENDENT_MODULE_ID><![CDATA[FF8080813141B198013141B86DD70003]]></AD_DEPENDENT_MODULE_ID>
-<!--FF8080813189932B013189B45B59003A-->  <STARTVERSION><![CDATA[0.1.18210]]></STARTVERSION>
+<!--FF8080813189932B013189B45B59003A-->  <STARTVERSION><![CDATA[0.1.18279]]></STARTVERSION>
 <!--FF8080813189932B013189B45B59003A-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--FF8080813189932B013189B45B59003A-->  <DEPENDANT_MODULE_NAME><![CDATA[OpenID Service Integration]]></DEPENDANT_MODULE_NAME>
 <!--FF8080813189932B013189B45B59003A-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -105,7 +105,7 @@
 <!--FF8080813189932B013189B4C00F003D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080813189932B013189B4C00F003D-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--FF8080813189932B013189B4C00F003D-->  <AD_DEPENDENT_MODULE_ID><![CDATA[FF8080813129ADA401312CA1222A0005]]></AD_DEPENDENT_MODULE_ID>
-<!--FF8080813189932B013189B4C00F003D-->  <STARTVERSION><![CDATA[0.1.18210]]></STARTVERSION>
+<!--FF8080813189932B013189B4C00F003D-->  <STARTVERSION><![CDATA[0.1.18279]]></STARTVERSION>
 <!--FF8080813189932B013189B4C00F003D-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--FF8080813189932B013189B4C00F003D-->  <DEPENDANT_MODULE_NAME><![CDATA[Integration with Google APIs]]></DEPENDANT_MODULE_NAME>
 <!--FF8080813189932B013189B4C00F003D-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -119,7 +119,7 @@
 <!--FF8081812E2F6F3C012E2F750109001C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <AD_DEPENDENT_MODULE_ID><![CDATA[FF8080812D842086012D844F3CC0003E]]></AD_DEPENDENT_MODULE_ID>
-<!--FF8081812E2F6F3C012E2F750109001C-->  <STARTVERSION><![CDATA[0.0.18210]]></STARTVERSION>
+<!--FF8081812E2F6F3C012E2F750109001C-->  <STARTVERSION><![CDATA[0.0.18279]]></STARTVERSION>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <DEPENDANT_MODULE_NAME><![CDATA[Widgets Collection]]></DEPENDANT_MODULE_NAME>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
Binary file src-db/database/lib/dbsourcemanager.jar has changed
--- a/src-db/database/model/functions/AD_GET_LEVEL_NODE_TREE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/functions/AD_GET_LEVEL_NODE_TREE.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -19,7 +19,7 @@
 * under the License.
 * The Original Code is Openbravo ERP.
 * The Initial Developer of the Original Code is Openbravo SLU
-* All portions are Copyright (C) 2001-2008 Openbravo SLU
+* All portions are Copyright (C) 2012 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
--- a/src-db/database/model/functions/AD_GET_NODE_TREE_BYLEVEL.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/functions/AD_GET_NODE_TREE_BYLEVEL.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -22,7 +22,7 @@
 * under the License.
 * The Original Code is Openbravo ERP.
 * The Initial Developer of the Original Code is Openbravo SLU
-* All portions are Copyright (C) 2001-2008 Openbravo SLU
+* All portions are Copyright (C) 2012 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
--- a/src-db/database/model/functions/AD_SYNCHRONIZE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/functions/AD_SYNCHRONIZE.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -233,8 +233,11 @@
                             AND T.AD_PACKAGE_ID = PA.AD_PACKAGE_ID
                             AND MT.AD_MODULE_ID = PA.AD_MODULE_ID                                                    
                             AND P.AD_MODULE_DBPREFIX_ID = (SELECT MAX(AD_MODULE_DBPREFIX_ID)
-                                                            FROM AD_MODULE_DBPREFIX P1
-                                                          WHERE P1.AD_MODULE_ID = C.Ad_MODULE_ID))
+								FROM AD_MODULE_DBPREFIX P1
+								WHERE P1.AD_MODULE_ID = C.Ad_MODULE_ID
+								AND ((instr(upper(C.columnname), 'EM_'||upper(P1.name)||'_') = 1)
+								OR (MT.AD_MODULE_ID = C.AD_MODULE_ID))
+								))
     WHERE AD_Element_ID IS NULL
       AND EXISTS (SELECT 1 
                     FROM AD_MODULE M
--- a/src-db/database/model/functions/C_ACCTSCHEMA_DEFAULT_COPY.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/functions/C_ACCTSCHEMA_DEFAULT_COPY.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -108,6 +108,8 @@
       UPDATE M_Product_Category_Acct
         SET P_Revenue_Acct=Cur_Acct.P_Revenue_Acct,
         P_Revenue_Return_Acct=Cur_Acct.P_Revenue_Return_Acct,
+        P_Def_Revenue_Acct=Cur_Acct.P_Def_Revenue_Acct,
+        P_Def_Expense_Acct=Cur_Acct.P_Def_Expense_Acct,
         P_Expense_Acct=Cur_Acct.P_Expense_Acct,
         P_Asset_Acct=Cur_Acct.P_Asset_Acct,
         P_CoGs_Acct=Cur_Acct.P_CoGs_Acct,
@@ -133,13 +135,13 @@
         (
           M_Product_Category_Acct_ID, M_Product_Category_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID,
           IsActive, Created, CreatedBy, Updated,
-          UpdatedBy, P_Revenue_Acct, P_Revenue_Return_Acct, P_Expense_Acct, P_Asset_Acct,
+          UpdatedBy, P_Revenue_Acct,  P_Def_Revenue_Acct, P_Revenue_Return_Acct, P_Expense_Acct, P_Def_Expense_Acct, P_Asset_Acct,
           P_CoGs_Acct, P_CoGs_Return_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct,
           P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct
         )
       SELECT get_uuid(), p.M_Product_Category_ID, Cur_Acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID,
         'Y', now(), '0', now(),
-        '0', Cur_Acct.P_Revenue_Acct, Cur_Acct.P_Revenue_Return_Acct, Cur_Acct.P_Expense_Acct,
+        '0', Cur_Acct.P_Revenue_Acct, Cur_Acct.P_Def_Revenue_Acct, Cur_Acct.P_Revenue_Return_Acct, Cur_Acct.P_Expense_Acct, Cur_Acct.P_Def_Expense_Acct,
         Cur_Acct.P_Asset_Acct, Cur_Acct.P_CoGs_Acct, Cur_Acct.P_CoGs_Return_Acct, Cur_Acct.P_PurchasePriceVariance_Acct,
         Cur_Acct.P_InvoicePriceVariance_Acct, Cur_Acct.P_TradeDiscountRec_Acct, Cur_Acct.P_TradeDiscountGrant_Acct
       FROM M_Product_Category p
--- a/src-db/database/model/functions/M_PRODUCT_CATEGORY_ACCT_COPY.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/functions/M_PRODUCT_CATEGORY_ACCT_COPY.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -25,7 +25,7 @@
   * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
   * All Rights Reserved.
   * Contributor(s): Openbravo SLU
-  * Contributions are Copyright (C) 2001-2008 Openbravo, S.L.U.
+  * Contributions are Copyright (C) 2001-2012 Openbravo, S.L.U.
   *
   * Specifically, this derivative work is based upon the following Compiere
   * file and version.
@@ -111,8 +111,10 @@
       -- Update existing Products
       UPDATE M_Product_Acct
         SET P_Revenue_Acct=Cur_Acct.P_Revenue_Acct,
+        P_Def_Revenue_Acct=Cur_Acct.P_Def_Revenue_Acct,
         P_Revenue_Return_Acct=Cur_Acct.P_Revenue_Return_Acct,
         P_Expense_Acct=Cur_Acct.P_Expense_Acct,
+        P_Def_Expense_Acct=Cur_Acct.P_Def_Expense_Acct,
         P_Asset_Acct=Cur_Acct.P_Asset_Acct,
         P_CoGs_Acct=Cur_Acct.P_CoGs_Acct,
         P_CoGs_Return_Acct=Cur_Acct.P_CoGs_Return_Acct,
@@ -138,14 +140,14 @@
         (
           M_Product_Acct_ID, M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID,
           IsActive, Created, CreatedBy, Updated,
-          UpdatedBy, P_Revenue_Acct, P_Revenue_Return_Acct, P_Expense_Acct, P_Asset_Acct,
+          UpdatedBy, P_Revenue_Acct, P_Def_Revenue_Acct, P_Revenue_Return_Acct, P_Expense_Acct, P_Def_Expense_Acct,P_Asset_Acct,
           P_CoGs_Acct, P_CoGs_Return_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,
           P_TradeDiscountGrant_Acct
         )
       SELECT get_uuid(), p.M_Product_ID,
         Cur_Acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y',
         now(), '0', now(), '0',
-        Cur_Acct.P_Revenue_Acct, Cur_Acct.P_Revenue_Return_Acct, Cur_Acct.P_Expense_Acct, Cur_Acct.P_Asset_Acct, Cur_Acct.P_CoGs_Acct, Cur_Acct.P_CoGs_Return_Acct,
+        Cur_Acct.P_Revenue_Acct, Cur_Acct.P_Def_Revenue_Acct, Cur_Acct.P_Revenue_Return_Acct, Cur_Acct.P_Expense_Acct, Cur_Acct.P_Def_Expense_Acct, Cur_Acct.P_Asset_Acct, Cur_Acct.P_CoGs_Acct, Cur_Acct.P_CoGs_Return_Acct,
         Cur_Acct.P_PurchasePriceVariance_Acct, Cur_Acct.P_InvoicePriceVariance_Acct, Cur_Acct.P_TradeDiscountRec_Acct, Cur_Acct.P_TradeDiscountGrant_Acct
       FROM M_Product p
       WHERE p.M_Product_Category_ID=Cur_Acct.M_Product_Category_ID
--- a/src-db/database/model/tables/C_ACCTSCHEMA_DEFAULT.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/tables/C_ACCTSCHEMA_DEFAULT.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -297,6 +297,20 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="P_DEF_REVENUE_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="P_DEF_EXPENSE_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <foreign-key foreignTable="C_VALIDCOMBINATION" name="C_ACCTSCH_DEF_P_PURCHASEPRICE">
+        <reference local="P_DEF_REVENUE_ACCT" foreign="C_VALIDCOMBINATION_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="C_VALIDCOMBINATION" name="C_ACCTSCH_DEF_P_SALEPRICE">
+        <reference local="P_DEF_EXPENSE_ACCT" foreign="C_VALIDCOMBINATION_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_VALIDCOMBINATION" name="C_ACCTSCHEMA_DEF_WRITEOFF_REV">
         <reference local="WRITEOFF_REV_ACCT" foreign="C_VALIDCOMBINATION_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/C_INVOICELINE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/tables/C_INVOICELINE.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -161,14 +161,46 @@
         <default><![CDATA[0]]></default>
         <onCreateDefault/>
       </column>
+      <column name="PERIODNUMBER" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <column name="GROSSPRICESTD" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
         <default><![CDATA[0]]></default>
         <onCreateDefault/>
       </column>
+      <column name="REVPLANTYPE" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <column name="GROSSPRICELIST" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
         <default><![CDATA[0]]></default>
         <onCreateDefault/>
       </column>
+      <column name="ISDEFERREDREVENUE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="C_PERIOD_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="EXPPLANTYPE" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="ISDEFERREDEXPENSE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="C_PERIOD_EXP_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="PERIODNUMBER_EXP" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_CLIENT" name="C_INVOICELINE_AD_CLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
@@ -190,6 +222,12 @@
       <foreign-key foreignTable="C_ORDERLINE" name="C_INVOICELINE_C_ORDERLINE">
         <reference local="C_ORDERLINE_ID" foreign="C_ORDERLINE_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_PERIOD" name="C_INVOICELINE_C_PERIOD">
+        <reference local="C_PERIOD_ID" foreign="C_PERIOD_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="C_PERIOD" name="C_INVOICELINE_C_PERIODEXP">
+        <reference local="C_PERIOD_EXP_ID" foreign="C_PERIOD_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_PROJECTLINE" name="C_INVOICELINE_C_PROJECTLINE">
         <reference local="C_PROJECTLINE_ID" foreign="C_PROJECTLINE_ID"/>
       </foreign-key>
@@ -229,8 +267,14 @@
       <index name="C_INVOICELINE_PRODUCT" unique="false">
         <index-column name="M_PRODUCT_ID"/>
       </index>
+      <check name="C_INVLINE_ISEXPDEFERRED_CHK"><![CDATA[ISDEFERREDEXPENSE IN ('Y', 'N')]]></check>
+      <check name="C_INVLINE_ISREVDEFERRED_CHK"><![CDATA[ISDEFERREDREVENUE IN ('Y', 'N')]]></check>
+      <check name="C_INVLINE_PERIODNUMBER_CHK"><![CDATA[((ISDEFERREDREVENUE = 'Y') AND (PERIODNUMBER > 0)) OR (ISDEFERREDREVENUE = 'N')]]></check>
+      <check name="C_INVLINE_PERIODNUMBEREXP_CHK"><![CDATA[((ISDEFERREDEXPENSE = 'Y') AND (PERIODNUMBER_EXP > 0)) OR (ISDEFERREDEXPENSE = 'N')]]></check>
       <check name="C_INVOICELINE_CHECK1"><![CDATA[((QUANTITYORDER IS NULL) AND (M_PRODUCT_UOM_ID IS NULL)) OR ((QUANTITYORDER IS NOT NULL) AND (M_PRODUCT_UOM_ID IS NOT NULL))]]></check>
       <check name="C_INVOICELINE_CHECK2"><![CDATA[(LINENETAMT = 0) OR (C_TAX_ID IS NOT NULL)]]></check>
+      <check name="C_INVOICELINE_CHECK3"><![CDATA[(((((ISDEFERREDREVENUE = 'Y') AND (C_PERIOD_ID IS NOT NULL)) AND (REVPLANTYPE IS NOT NULL)) AND (M_PRODUCT_ID IS NOT NULL)) AND (PERIODNUMBER IS NOT NULL)) OR (ISDEFERREDREVENUE = 'N')]]></check>
+      <check name="C_INVOICELINE_CHECK4"><![CDATA[(((((ISDEFERREDEXPENSE = 'Y') AND (C_PERIOD_EXP_ID IS NOT NULL)) AND (EXPPLANTYPE IS NOT NULL)) AND (M_PRODUCT_ID IS NOT NULL)) AND (PERIODNUMBER_EXP IS NOT NULL)) OR (ISDEFERREDEXPENSE = 'N')]]></check>
       <check name="C_INVOICELINE_FIN_INVLINE_CHK"><![CDATA[FINANCIAL_INVOICE_LINE IN ('Y', 'N')]]></check>
       <check name="C_INVOICELINE_FINACCT_CHK"><![CDATA[((FINANCIAL_INVOICE_LINE = 'Y') AND (ACCOUNT_ID IS NOT NULL)) OR ((FINANCIAL_INVOICE_LINE = 'N') AND (ACCOUNT_ID IS NULL))]]></check>
       <check name="C_INVOICELINE_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/tables/FIN_BANKFILE_EXCEPTION.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+  <database name="TABLE FIN_BANKFILE_EXCEPTION">
+    <table name="FIN_BANKFILE_EXCEPTION" primaryKey="FIN_BANKFILE_EXCEPTION_KEY">
+      <column name="FIN_BANKFILE_EXCEPTION_ID" primaryKey="true" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="FIN_BANKFILE_FORMAT_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="AD_CLIENT_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="AD_ORG_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="CREATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
+        <default><![CDATA[SYSDATE]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="CREATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="UPDATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
+        <default><![CDATA[SYSDATE]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="UPDATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="ISACTIVE" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[Y]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="FIN_FINANCIAL_ACCOUNT_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="TEXTTOEXCLUDE" primaryKey="false" required="true" type="VARCHAR" size="255" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <foreign-key foreignTable="AD_CLIENT" name="FIN_BANKFILE_EXCEPT_CLIENT">
+        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="AD_ORG" name="FIN_BANKFILE_EXCEPTION_ADORG">
+        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="FIN_BANKFILE_FORMAT" name="FIN_BANKFILE_EXCEPTION_BSL">
+        <reference local="FIN_BANKFILE_FORMAT_ID" foreign="FIN_BANKFILE_FORMAT_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="FIN_FINANCIAL_ACCOUNT" name="FIN_BANKFILE_EXCEPTION_FA">
+        <reference local="FIN_FINANCIAL_ACCOUNT_ID" foreign="FIN_FINANCIAL_ACCOUNT_ID"/>
+      </foreign-key>
+      <check name="FIN_BANKFILE_EX_ISACTIVE_CHK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
+    </table>
+  </database>
--- a/src-db/database/model/tables/FIN_BANKSTATEMENTLINE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/tables/FIN_BANKSTATEMENTLINE.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -77,6 +77,10 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="C_GLITEM_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_CLIENT" name="FIN_BANKSTATLINE_ADCLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
@@ -86,6 +90,9 @@
       <foreign-key foreignTable="C_BPARTNER" name="FIN_BANKSTATLINE_CBPARTNER">
         <reference local="C_BPARTNER_ID" foreign="C_BPARTNER_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_GLITEM" name="FIN_BANKSTATLINE_CGLITEM">
+        <reference local="C_GLITEM_ID" foreign="C_GLITEM_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="FIN_FINACC_TRANSACTION" name="FIN_BANKSTATLINE_FINACCTRX">
         <reference local="FIN_FINACC_TRANSACTION_ID" foreign="FIN_FINACC_TRANSACTION_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/FIN_FINACC_PAYMENTMETHOD.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/tables/FIN_FINACC_PAYMENTMETHOD.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -121,6 +121,10 @@
         <default><![CDATA[N]]></default>
         <onCreateDefault/>
       </column>
+      <column name="ISDEFAULT" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_CLIENT" name="FIN_FINACC_PAYMETHOD_CLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
@@ -146,6 +150,7 @@
       <check name="FIN_FAPM_PINMULTICUR_CHECK"><![CDATA[PAYIN_ISMULTICURRENCY IN ('Y', 'N')]]></check>
       <check name="FIN_FAPM_POUTMULTICUR_CHECK"><![CDATA[PAYOUT_ISMULTICURRENCY IN ('Y', 'N')]]></check>
       <check name="FIN_FINACC_METHOD_ACTIVE_CHK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
+      <check name="FIN_FINACC_METHOD_DEFAULT_CHK"><![CDATA[ISDEFAULT IN ('Y', 'N')]]></check>
       <check name="FIN_FINACC_METHOD_DEPOSIT_CHK"><![CDATA[AUTOMATIC_DEPOSIT IN ('Y', 'N')]]></check>
       <check name="FIN_FINACC_METHOD_PAYMENT_CHK"><![CDATA[AUTOMATIC_PAYMENT IN ('Y', 'N')]]></check>
       <check name="FIN_FINACC_METHOD_RECEIPT_CHK"><![CDATA[AUTOMATIC_RECEIPT IN ('Y', 'N')]]></check>
--- a/src-db/database/model/tables/M_PRODUCT.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/tables/M_PRODUCT.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -285,6 +285,30 @@
         <default><![CDATA[N]]></default>
         <onCreateDefault><![CDATA['N']]></onCreateDefault>
       </column>
+      <column name="ISDEFERREDREVENUE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="REVPLANTYPE" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="PERIODNUMBER" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="ISDEFERREDEXPENSE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="EXPPLANTYPE" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="PERIODNUMBER_EXP" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_ORG" name="AD_ORG_MPRODUCT">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
@@ -363,12 +387,18 @@
       <check name="M_PRODUCT_ENFORCE_ATTRIBUT_CHK"><![CDATA[ENFORCE_ATTRIBUTE IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISBOM_CHECK"><![CDATA[ISBOM IN ('Y', 'N')]]></check>
+      <check name="M_PRODUCT_ISEXPDEFCOMPLETE_CHK"><![CDATA[(ISDEFERREDEXPENSE = 'N') OR (((ISDEFERREDEXPENSE = 'Y') AND (EXPPLANTYPE IS NOT NULL)) AND (PERIODNUMBER_EXP IS NOT NULL))]]></check>
+      <check name="M_PRODUCT_ISEXPDEFERRED_CHK"><![CDATA[ISDEFERREDEXPENSE IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISINVOICEPRINTDE_CHK"><![CDATA[ISINVOICEPRINTDETAILS IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISPICKLISTPRINTD_CHK"><![CDATA[ISPICKLISTPRINTDETAILS IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISPURCHASED_CHECK"><![CDATA[ISPURCHASED IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISQTYVAR_CHECK"><![CDATA[ISQUANTITYVARIABLE IN ('Y', 'N')]]></check>
+      <check name="M_PRODUCT_ISREVDEFCOMPLETE_CHK"><![CDATA[(ISDEFERREDREVENUE = 'N') OR (((ISDEFERREDREVENUE = 'Y') AND (REVPLANTYPE IS NOT NULL)) AND (PERIODNUMBER IS NOT NULL))]]></check>
+      <check name="M_PRODUCT_ISREVDEFERRED_CHK"><![CDATA[ISDEFERREDREVENUE IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISSOLD_CHECK"><![CDATA[ISSOLD IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISSTOCKED_CHECK"><![CDATA[ISSTOCKED IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISVERIFIED_CHECK"><![CDATA[ISVERIFIED IN ('Y', 'N')]]></check>
+      <check name="M_PRODUCT_PERIODNUMBER_CHK"><![CDATA[((ISDEFERREDREVENUE = 'Y') AND (PERIODNUMBER > 0)) OR (ISDEFERREDREVENUE = 'N')]]></check>
+      <check name="M_PRODUCT_PERIODNUMEXP_CHK"><![CDATA[((ISDEFERREDEXPENSE = 'Y') AND (PERIODNUMBER_EXP > 0)) OR (ISDEFERREDEXPENSE = 'N')]]></check>
     </table>
   </database>
--- a/src-db/database/model/tables/M_PRODUCT_ACCT.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/tables/M_PRODUCT_ACCT.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -81,6 +81,14 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="P_DEF_REVENUE_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="P_DEF_EXPENSE_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_CLIENT" name="M_PRODUCT_ACCT_AD_CLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
@@ -99,6 +107,12 @@
       <foreign-key foreignTable="C_VALIDCOMBINATION" name="M_PRODUCT_ACCT_P_COGS_RETURN">
         <reference local="P_COGS_RETURN_ACCT" foreign="C_VALIDCOMBINATION_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_VALIDCOMBINATION" name="M_PRODUCT_ACCT_P_DEF_EXP_ACCT">
+        <reference local="P_DEF_EXPENSE_ACCT" foreign="C_VALIDCOMBINATION_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="C_VALIDCOMBINATION" name="M_PRODUCT_ACCT_P_DEF_REV_ACCT">
+        <reference local="P_DEF_REVENUE_ACCT" foreign="C_VALIDCOMBINATION_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_VALIDCOMBINATION" name="M_PRODUCT_ACCT_P_EXPENSE_ACCT">
         <reference local="P_EXPENSE_ACCT" foreign="C_VALIDCOMBINATION_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/M_PRODUCT_CATEGORY_ACCT.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/tables/M_PRODUCT_CATEGORY_ACCT.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -85,6 +85,20 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="P_DEF_REVENUE_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="P_DEF_EXPENSE_ACCT" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <foreign-key foreignTable="C_VALIDCOMBINATION" name="M_PROD_CAT_ACCT_P_DEFEXPENSE">
+        <reference local="P_DEF_EXPENSE_ACCT" foreign="C_VALIDCOMBINATION_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="C_VALIDCOMBINATION" name="M_PROD_CAT_ACCT_P_DEFREVENUE">
+        <reference local="P_DEF_REVENUE_ACCT" foreign="C_VALIDCOMBINATION_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="AD_CLIENT" name="M_PRODUCT_CATEGORY_ACCT_AD_CLI">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
--- a/src-db/database/model/triggers/C_INVLINE_CHK_RESTRICTIONS_TRG.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/triggers/C_INVLINE_CHK_RESTRICTIONS_TRG.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -23,6 +23,7 @@
     * Contributor(s):  ______________________________________.
     ************************************************************************/
   v_Processed VARCHAR(60) ;
+  v_Posted VARCHAR(60) ;
   v_C_INVOICE_ID VARCHAR2(32) ;
   v_Prec NUMBER:=2;
   v_Currency     VARCHAR2(32);
@@ -38,9 +39,9 @@
   ELSE
     v_C_INVOICE_ID:=:OLD.C_INVOICE_ID;
   END IF;
-  SELECT PROCESSED,
+  SELECT PROCESSED, POSTED,
     C_CURRENCY_ID
-  INTO v_Processed,
+  INTO v_Processed, v_Posted,
     v_Currency
   FROM C_INVOICE
   WHERE C_INVOICE_ID=v_C_INVOICE_ID;
@@ -67,6 +68,17 @@
       )) THEN
       RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
     END IF;
+    IF(v_Posted='Y' AND ((COALESCE(:OLD.ISDEFERREDREVENUE, '0') <> COALESCE(:NEW.ISDEFERREDREVENUE, '0'))
+         OR(COALESCE(:OLD.C_PERIOD_ID, '0') <> COALESCE(:NEW.C_PERIOD_ID, '0'))
+      OR(COALESCE(:OLD.REVPLANTYPE, '0') <> COALESCE(:NEW.REVPLANTYPE, '0'))
+      OR(COALESCE(:OLD.PERIODNUMBER, 0) <> COALESCE(:NEW.PERIODNUMBER, 0))
+      OR(COALESCE(:OLD.ISDEFERREDEXPENSE, '0') <> COALESCE(:NEW.ISDEFERREDEXPENSE, '0'))
+      OR(COALESCE(:OLD.C_PERIOD_EXP_ID, '0') <> COALESCE(:NEW.C_PERIOD_EXP_ID, '0'))
+      OR(COALESCE(:OLD.EXPPLANTYPE, '0') <> COALESCE(:NEW.EXPPLANTYPE, '0'))
+      OR(COALESCE(:OLD.PERIODNUMBER_EXP, 0) <> COALESCE(:NEW.PERIODNUMBER_EXP, 0))
+      )) THEN
+      RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
+    END IF;
   END IF;
   IF((DELETING OR INSERTING) AND v_Processed='Y') THEN
     RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
--- a/src-db/database/model/triggers/M_PRODUCT_CATEGORY_TRG.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/triggers/M_PRODUCT_CATEGORY_TRG.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -58,7 +58,7 @@
           M_Product_Category_Acct_ID, M_Product_Category_ID, C_AcctSchema_ID, AD_Client_ID,
           AD_Org_ID, IsActive, Created,
           CreatedBy, Updated, UpdatedBy,
-          P_Revenue_Acct, P_Expense_Acct, P_Asset_Acct,
+          P_Revenue_Acct, P_Def_Revenue_Acct, P_Expense_Acct, P_Def_Expense_Acct, P_Asset_Acct,
           P_COGS_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct,
           P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct,
           P_COGS_Return_Acct, P_Revenue_Return_Acct
@@ -68,7 +68,7 @@
           get_uuid(), :new.M_Product_Category_ID, Cur_Defaults.C_AcctSchema_ID, :new.AD_Client_ID,
           :new.AD_ORG_ID,  'Y', now(),
           :new.CreatedBy, now(), :new.UpdatedBy,
-          Cur_Defaults.P_Revenue_Acct, Cur_Defaults.P_Expense_Acct, Cur_Defaults.P_Asset_Acct,
+          Cur_Defaults.P_Revenue_Acct, Cur_Defaults.P_Def_Revenue_Acct, Cur_Defaults.P_Expense_Acct, Cur_Defaults.P_Def_Expense_Acct, Cur_Defaults.P_Asset_Acct,
           Cur_Defaults.P_COGS_Acct, Cur_Defaults.P_PurchasePriceVariance_Acct, Cur_Defaults.P_InvoicePriceVariance_Acct,
           Cur_Defaults.P_TradeDiscountRec_Acct, Cur_Defaults.P_TradeDiscountGrant_Acct,
           Cur_Defaults.P_COGS_Return_Acct, Cur_Defaults.P_Revenue_Return_Acct
--- a/src-db/database/model/triggers/M_PRODUCT_TRG.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/triggers/M_PRODUCT_TRG.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -31,7 +31,9 @@
     v_NextNo      			           VARCHAR2(32);
     v_ControlNo 	 	               NUMBER;
     v_P_Revenue_Acct    		       VARCHAR2(32);
+    v_P_Def_Revenue_Acct    		   VARCHAR2(32);
     v_P_Expense_Acct    		       VARCHAR2(32);
+    v_P_Def_Expense_Acct    		   VARCHAR2(32);
     v_P_Asset_Acct    			       VARCHAR2(32);
     v_P_COGS_Acct    			         VARCHAR2(32);
     v_P_PurchasePriceVariance_Acct VARCHAR2(32);
@@ -82,7 +84,7 @@
   FOR Cur_Defaults IN (
 	SELECT  distinct AD_IsOrgIncluded(:new.AD_ORG_ID, a.AD_Org_ID, :new.AD_Client_ID), 
   a.ad_sequence_pr_id,a.isprnewaccount,a.acct_length,a.subacct_length, d.ad_client_id, 
-  d.p_revenue_acct, d.p_expense_acct, d.p_asset_acct, d.p_cogs_acct, d.P_PurchasePriceVariance_Acct, d.P_InvoicePriceVariance_Acct,
+  d.p_revenue_acct, d.p_def_revenue_acct, d.p_expense_acct, d.p_def_expense_acct, d.p_asset_acct, d.p_cogs_acct, d.P_PurchasePriceVariance_Acct, d.P_InvoicePriceVariance_Acct,
   d.P_TradeDiscountRec_Acct, d.P_TradeDiscountGrant_Acct, d.P_COGS_Return_Acct, d.P_Revenue_Return_Acct, a.createdby, a.updatedby, a.C_AcctSchema_ID, d.ISACTIVE
   FROM  M_Product_Category_Acct d, ad_Org_AcctSchema a
 	WHERE  d.M_Product_Category_ID=:new.M_Product_Category_ID
@@ -106,10 +108,14 @@
             -- Retrieving the expense account number.
             AD_Sequence_Doc(v_seq_name, Cur_Defaults.AD_Client_ID, 'Y', v_Sequence_No);
             c_validcombination_clone(Cur_Defaults.P_Expense_Acct, v_Sequence_No, :new.Name, Cur_Defaults.acct_length, Cur_Defaults.subacct_length, v_P_Expense_Acct);
+            c_validcombination_clone(Cur_Defaults.P_Def_Expense_Acct, v_Sequence_No, :new.Name, Cur_Defaults.acct_length, Cur_Defaults.subacct_length, v_P_Def_Expense_Acct);
             
              -- Retrieving the revenue account number.
             c_validcombination_clone(Cur_Defaults.P_Revenue_Acct, v_Sequence_No, :new.Name, Cur_Defaults.acct_length, Cur_Defaults.subacct_length, v_P_Revenue_Acct);
             
+             -- Retrieving the revenue account number.
+            c_validcombination_clone(Cur_Defaults.P_Def_Revenue_Acct, v_Sequence_No, :new.Name, Cur_Defaults.acct_length, Cur_Defaults.subacct_length, v_P_Def_Revenue_Acct);
+            
             -- Retrieving the asset account number.
             c_validcombination_clone(Cur_Defaults.P_Asset_Acct, v_Sequence_No, :new.Name, Cur_Defaults.acct_length, Cur_Defaults.subacct_length, v_P_Asset_Acct);
 			
@@ -138,14 +144,14 @@
             INSERT INTO M_Product_Acct
             (M_Product_Acct_ID, M_Product_ID, C_AcctSchema_ID,
             AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,
-            P_Revenue_Acct, P_Expense_Acct, P_Asset_Acct, P_COGS_Acct,
+            P_Revenue_Acct, P_Def_Revenue_Acct, P_Expense_Acct, P_Def_Expense_Acct, P_Asset_Acct, P_COGS_Acct,
             P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct,
             P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct,
             P_COGS_Return_Acct, P_Revenue_Return_Acct)
             VALUES
             (get_uuid(), :new.M_Product_ID, Cur_Defaults.C_AcctSchema_ID,
             :new.AD_Client_ID, :new.AD_ORG_ID, Cur_Defaults.ISACTIVE, now(), :new.CreatedBy, now(), :new.UpdatedBy,
-            v_P_Revenue_Acct, v_P_Expense_Acct, v_P_Asset_Acct, v_P_COGS_Acct,
+            v_P_Revenue_Acct, v_P_Def_Revenue_Acct, v_P_Expense_Acct, v_P_Def_Expense_Acct, v_P_Asset_Acct, v_P_COGS_Acct,
             v_P_PurchasePriceVariance_Acct, v_P_InvoicePriceVariance_Acct,
             v_P_TradeDiscountRec_Acct, v_P_TradeDiscountGrant_Acct,
             v_P_COGS_Return_Acct, v_P_Revenue_Return_Acct); 
@@ -155,14 +161,14 @@
             INSERT INTO M_Product_Acct
             (M_Product_Acct_ID, M_Product_ID, C_AcctSchema_ID,
             AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,
-            P_Revenue_Acct, P_Expense_Acct, P_Asset_Acct, P_COGS_Acct,
+            P_Revenue_Acct, P_Def_Revenue_Acct, P_Expense_Acct, P_Def_Expense_Acct, P_Asset_Acct, P_COGS_Acct,
             P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct,
             P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct,
-	    P_COGS_Return_Acct, P_Revenue_Return_Acct)
+	    			P_COGS_Return_Acct, P_Revenue_Return_Acct)
             VALUES
 			      (get_uuid(), :new.M_Product_ID, Cur_Defaults.C_AcctSchema_ID,
 			      :new.AD_Client_ID, :new.AD_ORG_ID, Cur_Defaults.ISACTIVE, now(), :new.CreatedBy, now(), :new.UpdatedBy,
-			      Cur_Defaults.P_Revenue_Acct, Cur_Defaults.P_Expense_Acct, Cur_Defaults.P_Asset_Acct, Cur_Defaults.P_COGS_Acct,
+			      Cur_Defaults.P_Revenue_Acct, Cur_Defaults.P_Def_Revenue_Acct, Cur_Defaults.P_Expense_Acct, Cur_Defaults.P_Def_Expense_Acct, Cur_Defaults.P_Asset_Acct, Cur_Defaults.P_COGS_Acct,
             Cur_Defaults.P_PurchasePriceVariance_Acct, Cur_Defaults.P_InvoicePriceVariance_Acct,
             Cur_Defaults.P_TradeDiscountRec_Acct, Cur_Defaults.P_TradeDiscountGrant_Acct, 
             Cur_Defaults.P_COGS_Return_Acct, Cur_Defaults.P_Revenue_Return_Acct);
--- a/src-db/database/model/views/AD_AUDIT_TRAIL_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/AD_AUDIT_TRAIL_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,33 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW AD_AUDIT_TRAIL_V">
-    <view name="AD_AUDIT_TRAIL_V"><![CDATA[SELECT at.ad_audit_trail_id, at.ad_client_id, at.ad_org_id, at.isactive, at.created, at.createdby, at.updated, at.updatedby, at.ad_table_id, at.record_id, at.record_revision, at.ad_user_id, at.event_time, at.processtype, at.process_id, at.action, at.ad_column_id, at.old_char, at.new_char, at.old_nchar, at.new_nchar, at.old_number, at.new_number, at.old_date, at.new_date, at.old_text, at.new_text, 
-CASE
-WHEN at.processtype = 'P' THEN (SELECT to_char(p.name) AS to_char
-FROM ad_process p
-WHERE p.ad_process_id = at.process_id)
-WHEN at.processtype = 'W' THEN (SELECT to_char(w.name) AS to_char
-FROM ad_tab t, ad_window w
-WHERE t.ad_tab_id = at.process_id AND t.ad_window_id = w.ad_window_id)
-WHEN at.processtype = 'X' THEN (SELECT to_char(f.name) AS to_char
-FROM ad_form f
-WHERE f.ad_form_id = at.process_id)
-ELSE ''
-END AS process_desc, COALESCE(at.old_char, to_char(at.old_nchar), to_char(at.old_date), to_char(at.old_number), 
-CASE
-WHEN ad_get_rdbms() = 'ORACLE' THEN 
-CASE
-WHEN length(at.old_text) > 3996 THEN (to_char(substr(at.old_text, 1, 3996)) || '...')
-ELSE to_char(at.old_text)
-END
-ELSE to_char(at.old_text)
-END) AS old_value, COALESCE(at.new_char, to_char(at.new_nchar), to_char(at.new_date), to_char(at.new_number), 
-CASE
-WHEN ad_get_rdbms() = 'ORACLE' THEN 
-CASE
-WHEN length(at.new_text) > 3996 THEN (to_char(substr(at.new_text, 1, 3996)) || '...')
-ELSE to_char(at.new_text)
-END
-ELSE to_char(at.new_text)
-END) AS new_value
-FROM ad_audit_trail at]]></view>
+    <view name="AD_AUDIT_TRAIL_V"><![CDATA[SELECT at.ad_audit_trail_id, at.ad_client_id, at.ad_org_id, at.isactive, at.created, at.createdby, at.updated, at.updatedby, at.ad_table_id, at.record_id, at.record_revision, at.ad_user_id, at.event_time, at.processtype, at.process_id, at.action, at.ad_column_id, at.old_char, at.new_char, at.old_nchar, at.new_nchar, at.old_number, at.new_number, at.old_date, at.new_date, at.old_text, at.new_text,  CASE WHEN at.processtype = 'P' THEN (SELECT to_char(p.name) AS to_char FROM ad_process p WHERE p.ad_process_id = at.process_id) WHEN at.processtype = 'W' THEN (SELECT to_char(w.name) AS to_char FROM ad_tab t, ad_window w WHERE t.ad_tab_id = at.process_id AND t.ad_window_id = w.ad_window_id) WHEN at.processtype = 'X' THEN (SELECT to_char(f.name) AS to_char FROM ad_form f WHERE f.ad_form_id = at.process_id) ELSE '' END AS process_desc, COALESCE(at.old_char, to_char(at.old_nchar), to_char(at.old_date), to_char(at.old_number),  CASE WHEN ad_get_rdbms() = 'ORACLE' THEN  CASE WHEN length(at.old_text) > 3996 THEN (to_char(substr(at.old_text, 1, 3996)) || '...') ELSE to_char(at.old_text) END ELSE to_char(at.old_text) END) AS old_value, COALESCE(at.new_char, to_char(at.new_nchar), to_char(at.new_date), to_char(at.new_number),  CASE WHEN ad_get_rdbms() = 'ORACLE' THEN  CASE WHEN length(at.new_text) > 3996 THEN (to_char(substr(at.new_text, 1, 3996)) || '...') ELSE to_char(at.new_text) END ELSE to_char(at.new_text) END) AS new_value FROM ad_audit_trail at]]></view>
   </database>
--- a/src-db/database/model/views/AD_ORGMODULE_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/AD_ORGMODULE_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,10 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW AD_ORGMODULE_V">
-    <view name="AD_ORGMODULE_V"><![CDATA[SELECT ad_orgmodule.ad_orgmodule_id || ad_dataset.ad_dataset_id AS ad_orgmodule_v_id, ad_orgmodule.ad_org_id, ad_orgmodule.ad_client_id, ad_orgmodule.created, ad_orgmodule.isactive, ad_orgmodule.createdby, ad_orgmodule.updated, ad_orgmodule.updatedby, ad_dataset.ad_module_id, ad_orgmodule.version, ad_dataset.ad_dataset_id, ad_dataset.description, 
-CASE
-WHEN instr(ad_orgmodule.checksum, ad_dataset.checksum) = 0 THEN 'Y'
-ELSE 'N'
-END AS update_available
-FROM ad_orgmodule, ad_dataset
-WHERE ad_orgmodule.ad_module_id = ad_dataset.ad_module_id]]></view>
+    <view name="AD_ORGMODULE_V"><![CDATA[SELECT ad_orgmodule.ad_orgmodule_id || ad_dataset.ad_dataset_id AS ad_orgmodule_v_id, ad_orgmodule.ad_org_id, ad_orgmodule.ad_client_id, ad_orgmodule.created, ad_orgmodule.isactive, ad_orgmodule.createdby, ad_orgmodule.updated, ad_orgmodule.updatedby, ad_dataset.ad_module_id, ad_orgmodule.version, ad_dataset.ad_dataset_id, ad_dataset.description,  CASE WHEN instr(ad_orgmodule.checksum, ad_dataset.checksum) = 0 THEN 'Y' ELSE 'N' END AS update_available FROM ad_orgmodule, ad_dataset WHERE ad_orgmodule.ad_module_id = ad_dataset.ad_module_id]]></view>
   </database>
--- a/src-db/database/model/views/AD_PROCESS_EXECUTION_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/AD_PROCESS_EXECUTION_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,6 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW AD_PROCESS_EXECUTION_V">
-    <view name="AD_PROCESS_EXECUTION_V"><![CDATA[SELECT rn.ad_process_run_id, rn.ad_client_id, rn.ad_org_id, rn.isactive, rn.created, rn.createdby, rn.updated, rn.updatedby, rq.ad_user_id, rn.status, rn.start_time, rn.end_time, rn.runtime, rn.log, rn.result, rq.params, rn.report, rq.channel, rq.isrolesecurity, rq.ad_process_id, rn.ad_process_request_id
-FROM ad_process_run rn
-LEFT JOIN ad_process_request rq ON rn.ad_process_request_id = rq.ad_process_request_id]]></view>
+    <view name="AD_PROCESS_EXECUTION_V"><![CDATA[SELECT rn.ad_process_run_id, rn.ad_client_id, rn.ad_org_id, rn.isactive, rn.created, rn.createdby, rn.updated, rn.updatedby, rq.ad_user_id, rn.status, rn.start_time, rn.end_time, rn.runtime, rn.log, rn.result, rq.params, rn.report, rq.channel, rq.isrolesecurity, rq.ad_process_id, rn.ad_process_request_id FROM ad_process_run rn LEFT JOIN ad_process_request rq ON rn.ad_process_request_id = rq.ad_process_request_id]]></view>
   </database>
--- a/src-db/database/model/views/AD_REF_LIST_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/AD_REF_LIST_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,13 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW AD_REF_LIST_V">
-    <view name="AD_REF_LIST_V"><![CDATA[SELECT ad_ref_list.ad_ref_list_id, ad_ref_list.value, to_char(ad_ref_list.name) AS name, 'en_US' AS ad_language, ad_ref_list.ad_reference_id
-FROM ad_ref_list
-UNION 
-SELECT v1.ad_ref_list_id, v1.value, COALESCE(v1.name_trl, v2.name) AS name, v1.ad_language, v1.ad_reference_id
-FROM (SELECT ad_ref_list.ad_ref_list_id, ad_ref_list.value, to_char(ad_ref_list_trl.name) AS name_trl, '' AS name, ad_ref_list_trl.ad_language, ad_ref_list.ad_reference_id
-FROM ad_ref_list, ad_ref_list_trl
-WHERE ad_ref_list.ad_ref_list_id = ad_ref_list_trl.ad_ref_list_id) v1, (SELECT ad_ref_list.ad_ref_list_id, ad_ref_list.value, to_char(ad_ref_list.name) AS name, ad_language.ad_language, ad_ref_list.ad_reference_id
-FROM ad_ref_list, ad_language
-WHERE ad_language.issystemlanguage = 'Y') v2
-WHERE v1.ad_ref_list_id = v2.ad_ref_list_id AND v1.ad_reference_id = v2.ad_reference_id]]></view>
+    <view name="AD_REF_LIST_V"><![CDATA[SELECT ad_ref_list.ad_ref_list_id, ad_ref_list.value, to_char(ad_ref_list.name) AS name, 'en_US' AS ad_language, ad_ref_list.ad_reference_id FROM ad_ref_list UNION  SELECT v1.ad_ref_list_id, v1.value, COALESCE(v1.name_trl, v2.name) AS name, v1.ad_language, v1.ad_reference_id FROM (SELECT ad_ref_list.ad_ref_list_id, ad_ref_list.value, to_char(ad_ref_list_trl.name) AS name_trl, '' AS name, ad_ref_list_trl.ad_language, ad_ref_list.ad_reference_id FROM ad_ref_list, ad_ref_list_trl WHERE ad_ref_list.ad_ref_list_id = ad_ref_list_trl.ad_ref_list_id) v1, (SELECT ad_ref_list.ad_ref_list_id, ad_ref_list.value, to_char(ad_ref_list.name) AS name, ad_language.ad_language, ad_ref_list.ad_reference_id FROM ad_ref_list, ad_language WHERE ad_language.issystemlanguage = 'Y') v2 WHERE v1.ad_ref_list_id = v2.ad_ref_list_id AND v1.ad_reference_id = v2.ad_reference_id]]></view>
   </database>
--- a/src-db/database/model/views/AD_TABLE_POST_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/AD_TABLE_POST_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,26 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW AD_TABLE_POST_V">
-    <view name="AD_TABLE_POST_V"><![CDATA[SELECT ad_table.ad_table_id, (((ad_table.tablename || ' (') || (COALESCE(to_char(w2.name), '') || 
-CASE
-WHEN w2.name IS NULL THEN ''
-ELSE ' - '
-END)) || COALESCE(to_char(w1.name), ' - ')) || ')' AS name, w1.ad_language, ad_table.ad_client_id, ad_table.ad_org_id, ad_table.isactive, ad_table.created, ad_table.createdby, ad_table.updated, ad_table.updatedby
-FROM ad_table
-LEFT JOIN ad_window_trl w1 ON ad_table.ad_window_id = w1.ad_window_id
-LEFT JOIN ad_window_trl w2 ON ad_table.po_window_id = w2.ad_window_id
-WHERE (EXISTS (SELECT c.ad_column_id, c.ad_client_id, c.ad_org_id, c.isactive, c.created, c.updated, c.createdby, c.updatedby, c.name, c.description, c.help, c.columnname, c.ad_table_id, c.ad_reference_id, c.ad_reference_value_id, c.ad_val_rule_id, c.fieldlength, c.defaultvalue, c.iskey, c.isparent, c.ismandatory, c.isupdateable, c.readonlylogic, c.isidentifier, c.seqno, c.istranslated, c.isencrypted, c.callout, c.vformat, c.valuemin, c.valuemax, c.isselectioncolumn, c.ad_element_id, c.ad_process_id, c.issessionattr, c.issecondarykey, c.isdesencryptable, c.ad_callout_id, c.developmentstatus
-FROM ad_column c
-WHERE ad_table.ad_table_id = c.ad_table_id AND c.columnname = 'Posted')) AND w1.ad_language = COALESCE(w2.ad_language, w1.ad_language) AND ad_table.isactive = 'Y'
-UNION 
-SELECT ad_table.ad_table_id, (((ad_table.tablename || ' (') || (COALESCE(to_char(w2.name), '') || 
-CASE
-WHEN w2.name IS NULL THEN ''
-ELSE ' - '
-END)) || COALESCE(to_char(w1.name), ' - ')) || ')' AS name, 'en_US' AS ad_language, ad_table.ad_client_id, ad_table.ad_org_id, ad_table.isactive, ad_table.created, ad_table.createdby, ad_table.updated, ad_table.updatedby
-FROM ad_table
-LEFT JOIN ad_window w1 ON ad_table.ad_window_id = w1.ad_window_id
-LEFT JOIN ad_window w2 ON ad_table.po_window_id = w2.ad_window_id
-WHERE (EXISTS (SELECT c.ad_column_id, c.ad_client_id, c.ad_org_id, c.isactive, c.created, c.updated, c.createdby, c.updatedby, c.name, c.description, c.help, c.columnname, c.ad_table_id, c.ad_reference_id, c.ad_reference_value_id, c.ad_val_rule_id, c.fieldlength, c.defaultvalue, c.iskey, c.isparent, c.ismandatory, c.isupdateable, c.readonlylogic, c.isidentifier, c.seqno, c.istranslated, c.isencrypted, c.callout, c.vformat, c.valuemin, c.valuemax, c.isselectioncolumn, c.ad_element_id, c.ad_process_id, c.issessionattr, c.issecondarykey, c.isdesencryptable, c.ad_callout_id, c.developmentstatus
-FROM ad_column c
-WHERE ad_table.ad_table_id = c.ad_table_id AND c.columnname = 'Posted')) AND ad_table.isactive = 'Y']]></view>
+    <view name="AD_TABLE_POST_V"><![CDATA[SELECT ad_table.ad_table_id, (((ad_table.tablename || ' (') || (COALESCE(to_char(w2.name), '') ||  CASE WHEN w2.name IS NULL THEN '' ELSE ' - ' END)) || COALESCE(to_char(w1.name), ' - ')) || ')' AS name, w1.ad_language, ad_table.ad_client_id, ad_table.ad_org_id, ad_table.isactive, ad_table.created, ad_table.createdby, ad_table.updated, ad_table.updatedby FROM ad_table LEFT JOIN ad_window_trl w1 ON ad_table.ad_window_id = w1.ad_window_id LEFT JOIN ad_window_trl w2 ON ad_table.po_window_id = w2.ad_window_id WHERE (EXISTS (SELECT c.ad_column_id, c.ad_client_id, c.ad_org_id, c.isactive, c.created, c.updated, c.createdby, c.updatedby, c.name, c.description, c.help, c.columnname, c.ad_table_id, c.ad_reference_id, c.ad_reference_value_id, c.ad_val_rule_id, c.fieldlength, c.defaultvalue, c.iskey, c.isparent, c.ismandatory, c.isupdateable, c.readonlylogic, c.isidentifier, c.seqno, c.istranslated, c.isencrypted, c.callout, c.vformat, c.valuemin, c.valuemax, c.isselectioncolumn, c.ad_element_id, c.ad_process_id, c.issessionattr, c.issecondarykey, c.isdesencryptable, c.ad_callout_id, c.developmentstatus FROM ad_column c WHERE ad_table.ad_table_id = c.ad_table_id AND c.columnname = 'Posted')) AND w1.ad_language = COALESCE(w2.ad_language, w1.ad_language) AND ad_table.isactive = 'Y' UNION  SELECT ad_table.ad_table_id, (((ad_table.tablename || ' (') || (COALESCE(to_char(w2.name), '') ||  CASE WHEN w2.name IS NULL THEN '' ELSE ' - ' END)) || COALESCE(to_char(w1.name), ' - ')) || ')' AS name, 'en_US' AS ad_language, ad_table.ad_client_id, ad_table.ad_org_id, ad_table.isactive, ad_table.created, ad_table.createdby, ad_table.updated, ad_table.updatedby FROM ad_table LEFT JOIN ad_window w1 ON ad_table.ad_window_id = w1.ad_window_id LEFT JOIN ad_window w2 ON ad_table.po_window_id = w2.ad_window_id WHERE (EXISTS (SELECT c.ad_column_id, c.ad_client_id, c.ad_org_id, c.isactive, c.created, c.updated, c.createdby, c.updatedby, c.name, c.description, c.help, c.columnname, c.ad_table_id, c.ad_reference_id, c.ad_reference_value_id, c.ad_val_rule_id, c.fieldlength, c.defaultvalue, c.iskey, c.isparent, c.ismandatory, c.isupdateable, c.readonlylogic, c.isidentifier, c.seqno, c.istranslated, c.isencrypted, c.callout, c.vformat, c.valuemin, c.valuemax, c.isselectioncolumn, c.ad_element_id, c.ad_process_id, c.issessionattr, c.issecondarykey, c.isdesencryptable, c.ad_callout_id, c.developmentstatus FROM ad_column c WHERE ad_table.ad_table_id = c.ad_table_id AND c.columnname = 'Posted')) AND ad_table.isactive = 'Y']]></view>
   </database>
--- a/src-db/database/model/views/C_DEBT_PAYMENT_CANCEL.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/C_DEBT_PAYMENT_CANCEL.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,6 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW C_DEBT_PAYMENT_CANCEL">
-    <view name="C_DEBT_PAYMENT_CANCEL"><![CDATA[SELECT c_debt_payment.c_debt_payment_id, c_debt_payment.ad_client_id, c_debt_payment.ad_org_id, c_debt_payment.isactive, c_debt_payment.created, c_debt_payment.createdby, c_debt_payment.updated, c_debt_payment.updatedby, c_debt_payment.isreceipt, c_debt_payment.c_settlement_cancel_id AS c_settlement_id, c_debt_payment.description, c_debt_payment.c_invoice_id, c_debt_payment.c_bpartner_id, c_debt_payment.c_currency_id, c_debt_payment.c_cashline_id, c_debt_payment.c_bankstatementline_id, c_debt_payment.c_bankaccount_id, c_debt_payment.c_cashbook_id, c_debt_payment.paymentrule, c_debt_payment.ispaid, c_debt_payment.amount, c_debt_payment.writeoffamt, c_debt_payment.dateplanned, c_debt_payment.ismanual, c_debt_payment.isvalid, c_debt_payment.changesettlementcancel, c_debt_payment.cancel_processed, c_debt_payment.status, c_debt_payment.c_withholding_id, c_debt_payment.withholdingamount, c_debt_payment.c_settlement_generate_id
-FROM c_debt_payment
-WHERE c_debt_payment.c_settlement_cancel_id IS NOT NULL]]></view>
+    <view name="C_DEBT_PAYMENT_CANCEL"><![CDATA[SELECT c_debt_payment.c_debt_payment_id, c_debt_payment.ad_client_id, c_debt_payment.ad_org_id, c_debt_payment.isactive, c_debt_payment.created, c_debt_payment.createdby, c_debt_payment.updated, c_debt_payment.updatedby, c_debt_payment.isreceipt, c_debt_payment.c_settlement_cancel_id AS c_settlement_id, c_debt_payment.description, c_debt_payment.c_invoice_id, c_debt_payment.c_bpartner_id, c_debt_payment.c_currency_id, c_debt_payment.c_cashline_id, c_debt_payment.c_bankstatementline_id, c_debt_payment.c_bankaccount_id, c_debt_payment.c_cashbook_id, c_debt_payment.paymentrule, c_debt_payment.ispaid, c_debt_payment.amount, c_debt_payment.writeoffamt, c_debt_payment.dateplanned, c_debt_payment.ismanual, c_debt_payment.isvalid, c_debt_payment.changesettlementcancel, c_debt_payment.cancel_processed, c_debt_payment.status, c_debt_payment.c_withholding_id, c_debt_payment.withholdingamount, c_debt_payment.c_settlement_generate_id FROM c_debt_payment WHERE c_debt_payment.c_settlement_cancel_id IS NOT NULL]]></view>
   </database>
--- a/src-db/database/model/views/C_DEBT_PAYMENT_GENERATE.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/C_DEBT_PAYMENT_GENERATE.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,6 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW C_DEBT_PAYMENT_GENERATE">
-    <view name="C_DEBT_PAYMENT_GENERATE"><![CDATA[SELECT c_debt_payment.c_debt_payment_id, c_debt_payment.ad_client_id, c_debt_payment.ad_org_id, c_debt_payment.isactive, c_debt_payment.created, c_debt_payment.createdby, c_debt_payment.updated, c_debt_payment.updatedby, c_debt_payment.isreceipt, c_debt_payment.c_settlement_generate_id AS c_settlement_id, c_debt_payment.description, c_debt_payment.c_invoice_id, c_debt_payment.c_bpartner_id, c_debt_payment.c_currency_id, c_debt_payment.c_cashline_id, c_debt_payment.c_bankstatementline_id, c_debt_payment.c_bankaccount_id, c_debt_payment.c_cashbook_id, c_debt_payment.paymentrule, c_debt_payment.ispaid, c_debt_payment.amount, c_debt_payment.writeoffamt, c_debt_payment.dateplanned, c_debt_payment.ismanual, c_debt_payment.isvalid, c_debt_payment.generate_processed, c_debt_payment.glitemamt, c_debt_payment.c_settlement_cancel_id, c_debt_payment.c_glitem_id, c_debt_payment.isdirectposting, c_debt_payment.status_initial AS status, c_debt_payment.c_project_id, c_debt_payment.c_withholding_id, c_debt_payment.withholdingamount
-FROM c_debt_payment
-WHERE c_debt_payment.c_settlement_generate_id IS NOT NULL]]></view>
+    <view name="C_DEBT_PAYMENT_GENERATE"><![CDATA[SELECT c_debt_payment.c_debt_payment_id, c_debt_payment.ad_client_id, c_debt_payment.ad_org_id, c_debt_payment.isactive, c_debt_payment.created, c_debt_payment.createdby, c_debt_payment.updated, c_debt_payment.updatedby, c_debt_payment.isreceipt, c_debt_payment.c_settlement_generate_id AS c_settlement_id, c_debt_payment.description, c_debt_payment.c_invoice_id, c_debt_payment.c_bpartner_id, c_debt_payment.c_currency_id, c_debt_payment.c_cashline_id, c_debt_payment.c_bankstatementline_id, c_debt_payment.c_bankaccount_id, c_debt_payment.c_cashbook_id, c_debt_payment.paymentrule, c_debt_payment.ispaid, c_debt_payment.amount, c_debt_payment.writeoffamt, c_debt_payment.dateplanned, c_debt_payment.ismanual, c_debt_payment.isvalid, c_debt_payment.generate_processed, c_debt_payment.glitemamt, c_debt_payment.c_settlement_cancel_id, c_debt_payment.c_glitem_id, c_debt_payment.isdirectposting, c_debt_payment.status_initial AS status, c_debt_payment.c_project_id, c_debt_payment.c_withholding_id, c_debt_payment.withholdingamount FROM c_debt_payment WHERE c_debt_payment.c_settlement_generate_id IS NOT NULL]]></view>
   </database>
--- a/src-db/database/model/views/C_DEBT_PAYMENT_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/C_DEBT_PAYMENT_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,24 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW C_DEBT_PAYMENT_V">
-    <view name="C_DEBT_PAYMENT_V"><![CDATA[SELECT c_debt_payment.c_debt_payment_id AS c_debt_payment_v_id, c_debt_payment.c_debt_payment_id, c_debt_payment.ad_client_id, c_debt_payment.ad_org_id, c_debt_payment.isactive, c_debt_payment.created, c_debt_payment.createdby, c_debt_payment.updated, c_debt_payment.updatedby, c_debt_payment.isreceipt, c_debt_payment.c_settlement_cancel_id, c_debt_payment.c_settlement_generate_id, c_debt_payment.description, c_debt_payment.c_invoice_id, c_debt_payment.c_bpartner_id, c_debt_payment.c_currency_id, c_debt_payment.c_cashline_id, c_debt_payment.c_bankaccount_id, c_debt_payment.c_cashbook_id, c_debt_payment.paymentrule, c_debt_payment.ispaid, c_debt_payment.dateplanned, c_debt_payment.ismanual, c_debt_payment.isvalid, c_debt_payment.c_bankstatementline_id, c_debt_payment.changesettlementcancel, c_debt_payment.cancel_processed, c_debt_payment.generate_processed, c_debt_payment.c_withholding_id, c_debt_payment.withholdingamount, 
-CASE c_debt_payment.isreceipt
-WHEN 'Y' THEN c_debt_payment.amount
-ELSE c_debt_payment.amount * (-1)
-END AS amount, 
-CASE c_debt_payment.isreceipt
-WHEN 'Y' THEN c_debt_payment.writeoffamt
-ELSE c_debt_payment.writeoffamt * (-1)
-END AS writeoffamt, 
-CASE c_debt_payment.isreceipt
-WHEN 'Y' THEN 1
-ELSE (-1)
-END AS multiplierap, 
-CASE
-WHEN c_debt_payment.c_invoice_id IS NOT NULL THEN c_invoice.dateinvoiced
-WHEN c_debt_payment.c_settlement_generate_id IS NOT NULL THEN c_settlement.datetrx
-ELSE to_date(now())
-END AS docdate, c_debt_payment.glitemamt, c_debt_payment.c_order_id, c_debt_payment.status
-FROM c_debt_payment
-LEFT JOIN c_invoice ON c_debt_payment.c_invoice_id = c_invoice.c_invoice_id
-LEFT JOIN c_settlement ON c_debt_payment.c_settlement_generate_id = c_settlement.c_settlement_id]]></view>
+    <view name="C_DEBT_PAYMENT_V"><![CDATA[SELECT c_debt_payment.c_debt_payment_id AS c_debt_payment_v_id, c_debt_payment.c_debt_payment_id, c_debt_payment.ad_client_id, c_debt_payment.ad_org_id, c_debt_payment.isactive, c_debt_payment.created, c_debt_payment.createdby, c_debt_payment.updated, c_debt_payment.updatedby, c_debt_payment.isreceipt, c_debt_payment.c_settlement_cancel_id, c_debt_payment.c_settlement_generate_id, c_debt_payment.description, c_debt_payment.c_invoice_id, c_debt_payment.c_bpartner_id, c_debt_payment.c_currency_id, c_debt_payment.c_cashline_id, c_debt_payment.c_bankaccount_id, c_debt_payment.c_cashbook_id, c_debt_payment.paymentrule, c_debt_payment.ispaid, c_debt_payment.dateplanned, c_debt_payment.ismanual, c_debt_payment.isvalid, c_debt_payment.c_bankstatementline_id, c_debt_payment.changesettlementcancel, c_debt_payment.cancel_processed, c_debt_payment.generate_processed, c_debt_payment.c_withholding_id, c_debt_payment.withholdingamount,  CASE c_debt_payment.isreceipt WHEN 'Y' THEN c_debt_payment.amount ELSE c_debt_payment.amount * (-1) END AS amount,  CASE c_debt_payment.isreceipt WHEN 'Y' THEN c_debt_payment.writeoffamt ELSE c_debt_payment.writeoffamt * (-1) END AS writeoffamt,  CASE c_debt_payment.isreceipt WHEN 'Y' THEN 1 ELSE (-1) END AS multiplierap,  CASE WHEN c_debt_payment.c_invoice_id IS NOT NULL THEN c_invoice.dateinvoiced WHEN c_debt_payment.c_settlement_generate_id IS NOT NULL THEN c_settlement.datetrx ELSE to_date(now()) END AS docdate, c_debt_payment.glitemamt, c_debt_payment.c_order_id, c_debt_payment.status FROM c_debt_payment LEFT JOIN c_invoice ON c_debt_payment.c_invoice_id = c_invoice.c_invoice_id LEFT JOIN c_settlement ON c_debt_payment.c_settlement_generate_id = c_settlement.c_settlement_id]]></view>
   </database>
--- a/src-db/database/model/views/C_INVOICELINE_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/C_INVOICELINE_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,14 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW C_INVOICELINE_V">
-    <view name="C_INVOICELINE_V"><![CDATA[SELECT il.ad_client_id, il.ad_org_id, il.c_invoiceline_id, i.c_invoice_id, i.salesrep_id, i.c_bpartner_id, il.m_product_id, i.documentno, i.dateinvoiced, i.dateacct, i.issotrx, i.docstatus, round(i.multiplier * il.linenetamt, 2) AS linenetamt, round(i.multiplier * il.pricelist * il.qtyinvoiced, 2) AS linelistamt, 
-CASE
-WHEN il.pricelimit IS NULL THEN round(i.multiplier * il.linenetamt, 2)
-ELSE round(i.multiplier * il.pricelimit * il.qtyinvoiced, 2)
-END AS linelimitamt, round(i.multiplier * il.pricelist * il.qtyinvoiced - il.linenetamt, 2) AS linediscountamt, 
-CASE
-WHEN il.pricelimit IS NULL THEN 0
-ELSE round(i.multiplier * il.linenetamt - il.pricelimit * il.qtyinvoiced, 2)
-END AS lineoverlimitamt, il.qtyinvoiced, il.line, il.c_orderline_id, il.c_uom_id
-FROM c_invoice_v i, c_invoiceline il
-WHERE i.c_invoice_id = il.c_invoice_id]]></view>
+    <view name="C_INVOICELINE_V"><![CDATA[SELECT il.ad_client_id, il.ad_org_id, il.c_invoiceline_id, i.c_invoice_id, i.salesrep_id, i.c_bpartner_id, il.m_product_id, i.documentno, i.dateinvoiced, i.dateacct, i.issotrx, i.docstatus, round(i.multiplier * il.linenetamt, 2) AS linenetamt, round(i.multiplier * il.pricelist * il.qtyinvoiced, 2) AS linelistamt,  CASE WHEN il.pricelimit IS NULL THEN round(i.multiplier * il.linenetamt, 2) ELSE round(i.multiplier * il.pricelimit * il.qtyinvoiced, 2) END AS linelimitamt, round(i.multiplier * il.pricelist * il.qtyinvoiced - il.linenetamt, 2) AS linediscountamt,  CASE WHEN il.pricelimit IS NULL THEN 0 ELSE round(i.multiplier * il.linenetamt - il.pricelimit * il.qtyinvoiced, 2) END AS lineoverlimitamt, il.qtyinvoiced, il.line, il.c_orderline_id, il.c_uom_id FROM c_invoice_v i, c_invoiceline il WHERE i.c_invoice_id = il.c_invoice_id]]></view>
   </database>
--- a/src-db/database/model/views/C_INVOICELINE_V2.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/C_INVOICELINE_V2.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,23 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW C_INVOICELINE_V2">
-    <view name="C_INVOICELINE_V2"><![CDATA[SELECT il.c_invoiceline_id AS c_invoiceline_v2_id, il.ad_client_id, il.ad_org_id, il.isactive, il.created, il.createdby, il.updated, il.updatedby, il.c_invoiceline_id, i.c_invoice_id, i.salesrep_id, i.c_bpartner_id, i.c_bp_group_id, il.m_product_id, p.m_product_category_id, i.dateinvoiced, i.dateacct, il.qtyinvoiced * i.multiplier AS qtyinvoiced, il.pricelist, il.priceactual, il.pricelimit, 
-CASE il.pricelist
-WHEN 0 THEN 0
-ELSE round((il.pricelist - il.priceactual) / il.pricelist * 100, 2)
-END AS discount, 
-CASE il.pricelimit
-WHEN 0 THEN 0
-ELSE round((il.priceactual - il.pricelimit) / il.pricelimit * 100, 2)
-END AS margin, round(i.multiplier * il.linenetamt, 2) AS linenetamt, round(i.multiplier * il.pricelist * il.qtyinvoiced, 2) AS linelistamt, 
-CASE
-WHEN il.pricelimit IS NULL THEN round(i.multiplier * il.linenetamt, 2)
-ELSE round(i.multiplier * il.pricelimit * il.qtyinvoiced, 2)
-END AS linelimitamt, round(i.multiplier * il.pricelist * il.qtyinvoiced - il.linenetamt, 2) AS linediscountamt, 
-CASE
-WHEN il.pricelimit IS NULL THEN 0
-ELSE round(i.multiplier * il.linenetamt - il.pricelimit * il.qtyinvoiced, 2)
-END AS lineoverlimitamt, il.account_id
-FROM c_invoice_v2 i, c_invoiceline il
-LEFT JOIN m_product p ON il.m_product_id = p.m_product_id
-WHERE i.c_invoice_id = il.c_invoice_id]]></view>
+    <view name="C_INVOICELINE_V2"><![CDATA[SELECT il.c_invoiceline_id AS c_invoiceline_v2_id, il.ad_client_id, il.ad_org_id, il.isactive, il.created, il.createdby, il.updated, il.updatedby, il.c_invoiceline_id, i.c_invoice_id, i.salesrep_id, i.c_bpartner_id, i.c_bp_group_id, il.m_product_id, p.m_product_category_id, i.dateinvoiced, i.dateacct, il.qtyinvoiced * i.multiplier AS qtyinvoiced, il.pricelist, il.priceactual, il.pricelimit,  CASE il.pricelist WHEN 0 THEN 0 ELSE round((il.pricelist - il.priceactual) / il.pricelist * 100, 2) END AS discount,  CASE il.pricelimit WHEN 0 THEN 0 ELSE round((il.priceactual - il.pricelimit) / il.pricelimit * 100, 2) END AS margin, round(i.multiplier * il.linenetamt, 2) AS linenetamt, round(i.multiplier * il.pricelist * il.qtyinvoiced, 2) AS linelistamt,  CASE WHEN il.pricelimit IS NULL THEN round(i.multiplier * il.linenetamt, 2) ELSE round(i.multiplier * il.pricelimit * il.qtyinvoiced, 2) END AS linelimitamt, round(i.multiplier * il.pricelist * il.qtyinvoiced - il.linenetamt, 2) AS linediscountamt,  CASE WHEN il.pricelimit IS NULL THEN 0 ELSE round(i.multiplier * il.linenetamt - il.pricelimit * il.qtyinvoiced, 2) END AS lineoverlimitamt, il.account_id FROM c_invoice_v2 i, c_invoiceline il LEFT JOIN m_product p ON il.m_product_id = p.m_product_id WHERE i.c_invoice_id = il.c_invoice_id]]></view>
   </database>
--- a/src-db/database/model/views/C_INVOICE_CANDIDATE_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/C_INVOICE_CANDIDATE_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,18 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW C_INVOICE_CANDIDATE_V">
-    <view name="C_INVOICE_CANDIDATE_V"><![CDATA[SELECT sq.ad_client_id, sq.ad_org_id, sq.c_bpartner_id, sq.c_order_id, sq.documentno, sq.dateordered, sq.c_doctype_id, sq.amountlines, sq.amountlinesgross, sq.notinvoicedlines, round(sq.notinvoicedlinesgross, c.stdprecision) AS notinvoicedlinesgross, sq.term, sq.pendinglines, round(sq.pendinglinesgross, c.stdprecision) AS pendinglinesgross, sq.qtyordered, sq.qtydelivered
-FROM (SELECT o.ad_client_id, o.ad_org_id, o.c_bpartner_id, o.c_order_id, o.documentno, o.dateordered, o.c_doctype_id, o.totallines AS amountlines, o.grandtotal AS amountlinesgross, sum(round((l.qtyordered - l.qtyinvoiced) * l.priceactual, c.stdprecision)) AS notinvoicedlines, sum(round((l.qtyordered - l.qtyinvoiced) * l.priceactual, c.stdprecision) * (1 + t.rate / 100)) AS notinvoicedlinesgross, o.invoicerule AS term, sum(round((l.qtydelivered - l.qtyinvoiced) * l.priceactual, c.stdprecision)) AS pendinglines, sum(round((l.qtydelivered - l.qtyinvoiced) * l.priceactual, c.stdprecision) * (1 + t.rate / 100)) AS pendinglinesgross, sum(abs(l.qtyordered)) AS qtyordered, sum(abs(l.qtydelivered)) AS qtydelivered, o.m_pricelist_id, c.c_currency_id
-FROM c_order o
-JOIN m_pricelist p ON o.m_pricelist_id = p.m_pricelist_id
-JOIN c_currency c ON p.c_currency_id = c.c_currency_id
-JOIN c_orderline l ON o.c_order_id = l.c_order_id
-JOIN c_bpartner bp ON o.c_bpartner_id = bp.c_bpartner_id
-JOIN c_tax t ON t.c_tax_id = l.c_tax_id
-LEFT JOIN c_invoiceschedule si ON bp.c_invoiceschedule_id = si.c_invoiceschedule_id
-WHERE (o.docstatus IN ('CO', 'CL', 'IP')) AND (o.c_doctype_id IN (SELECT c_doctype.c_doctype_id
-FROM c_doctype
-WHERE c_doctype.docbasetype = 'SOO' AND (c_doctype.docsubtypeso NOT IN ('ON', 'OB', 'WR')))) AND (o.invoicerule = 'I' OR o.invoicerule = 'O' OR o.invoicerule = 'N' OR o.invoicerule = 'D' OR o.invoicerule = 'S' AND (si.invoicefrequency IS NULL OR si.invoicefrequency = 'D' OR si.invoicefrequency = 'W' OR si.invoicefrequency = 'T' AND trunc(o.dateordered) <= (TRUNC(now(), 'MM') + si.invoicedaycutoff - 1) AND trunc(now()) >= (TRUNC(o.dateordered, 'MM') + si.invoiceday - 1) OR trunc(o.dateordered) <= (TRUNC(now(), 'MM') + si.invoicedaycutoff + 14) AND trunc(now()) >= (TRUNC(o.dateordered, 'MM') + si.invoiceday + 14) OR si.invoicefrequency = 'M' AND trunc(o.dateordered) <= (TRUNC(now(), 'MM') + si.invoicedaycutoff - 1) AND trunc(now()) >= (TRUNC(o.dateordered, 'MM') + si.invoiceday - 1))) AND (abs(l.qtyordered - l.qtyinvoiced) <> 0 OR abs(l.qtydelivered - l.qtyinvoiced) <> 0)
-GROUP BY o.ad_client_id, o.ad_org_id, o.c_bpartner_id, o.c_order_id, o.documentno, o.dateordered, o.c_doctype_id, o.totallines, o.grandtotal, o.invoicerule, o.m_pricelist_id, c.c_currency_id) sq
-JOIN m_pricelist p ON sq.m_pricelist_id = p.m_pricelist_id
-JOIN c_currency c ON sq.c_currency_id = c.c_currency_id]]></view>
+    <view name="C_INVOICE_CANDIDATE_V"><![CDATA[SELECT sq.ad_client_id, sq.ad_org_id, sq.c_bpartner_id, sq.c_order_id, sq.documentno, sq.dateordered, sq.c_doctype_id, sq.amountlines, sq.amountlinesgross, sq.notinvoicedlines, round(sq.notinvoicedlinesgross, c.stdprecision) AS notinvoicedlinesgross, sq.term, sq.pendinglines, round(sq.pendinglinesgross, c.stdprecision) AS pendinglinesgross, sq.qtyordered, sq.qtydelivered FROM (SELECT o.ad_client_id, o.ad_org_id, o.c_bpartner_id, o.c_order_id, o.documentno, o.dateordered, o.c_doctype_id, o.totallines AS amountlines, o.grandtotal AS amountlinesgross, sum(round((l.qtyordered - l.qtyinvoiced) * l.priceactual, c.stdprecision)) AS notinvoicedlines, sum(round((l.qtyordered - l.qtyinvoiced) * l.priceactual, c.stdprecision) * (1 + t.rate / 100)) AS notinvoicedlinesgross, o.invoicerule AS term, sum(round((l.qtydelivered - l.qtyinvoiced) * l.priceactual, c.stdprecision)) AS pendinglines, sum(round((l.qtydelivered - l.qtyinvoiced) * l.priceactual, c.stdprecision) * (1 + t.rate / 100)) AS pendinglinesgross, sum(abs(l.qtyordered)) AS qtyordered, sum(abs(l.qtydelivered)) AS qtydelivered, o.m_pricelist_id, c.c_currency_id FROM c_order o JOIN m_pricelist p ON o.m_pricelist_id = p.m_pricelist_id JOIN c_currency c ON p.c_currency_id = c.c_currency_id JOIN c_orderline l ON o.c_order_id = l.c_order_id JOIN c_bpartner bp ON o.c_bpartner_id = bp.c_bpartner_id JOIN c_tax t ON t.c_tax_id = l.c_tax_id LEFT JOIN c_invoiceschedule si ON bp.c_invoiceschedule_id = si.c_invoiceschedule_id WHERE (o.docstatus IN ('CO', 'CL', 'IP')) AND (o.c_doctype_id IN (SELECT c_doctype.c_doctype_id FROM c_doctype WHERE c_doctype.docbasetype = 'SOO' AND (c_doctype.docsubtypeso NOT IN ('ON', 'OB', 'WR')))) AND (o.invoicerule = 'I' OR o.invoicerule = 'O' OR o.invoicerule = 'N' OR o.invoicerule = 'D' OR o.invoicerule = 'S' AND (si.invoicefrequency IS NULL OR si.invoicefrequency = 'D' OR si.invoicefrequency = 'W' OR si.invoicefrequency = 'T' AND trunc(o.dateordered) <= (TRUNC(now(), 'MM') + si.invoicedaycutoff - 1) AND trunc(now()) >= (TRUNC(o.dateordered, 'MM') + si.invoiceday - 1) OR trunc(o.dateordered) <= (TRUNC(now(), 'MM') + si.invoicedaycutoff + 14) AND trunc(now()) >= (TRUNC(o.dateordered, 'MM') + si.invoiceday + 14) OR si.invoicefrequency = 'M' AND trunc(o.dateordered) <= (TRUNC(now(), 'MM') + si.invoicedaycutoff - 1) AND trunc(now()) >= (TRUNC(o.dateordered, 'MM') + si.invoiceday - 1))) AND (abs(l.qtyordered - l.qtyinvoiced) <> 0 OR abs(l.qtydelivered - l.qtyinvoiced) <> 0) GROUP BY o.ad_client_id, o.ad_org_id, o.c_bpartner_id, o.c_order_id, o.documentno, o.dateordered, o.c_doctype_id, o.totallines, o.grandtotal, o.invoicerule, o.m_pricelist_id, c.c_currency_id) sq JOIN m_pricelist p ON sq.m_pricelist_id = p.m_pricelist_id JOIN c_currency c ON sq.c_currency_id = c.c_currency_id]]></view>
   </database>
--- a/src-db/database/model/views/C_INVOICE_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/C_INVOICE_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,26 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW C_INVOICE_V">
-    <view name="C_INVOICE_V"><![CDATA[SELECT i.c_invoice_id, i.ad_client_id, i.ad_org_id, i.isactive, i.created, i.createdby, i.updated, i.updatedby, i.issotrx, i.documentno, i.docstatus, i.docaction, i.processing, i.processed, i.c_doctype_id, i.c_doctypetarget_id, i.c_order_id, i.description, i.salesrep_id, i.dateinvoiced, i.dateprinted, i.dateacct, i.c_bpartner_id, i.c_bpartner_location_id, i.ad_user_id, i.poreference, i.dateordered, i.c_currency_id, i.paymentrule, i.c_paymentterm_id, i.c_charge_id, i.m_pricelist_id, i.c_campaign_id, i.c_project_id, i.c_activity_id, i.isprinted, i.isdiscountprinted, 
-CASE
-WHEN substr(d.docbasetype, 3) = 'C' THEN i.chargeamt * (-1)
-ELSE i.chargeamt
-END AS chargeamt, 
-CASE
-WHEN substr(d.docbasetype, 3) = 'C' THEN i.totallines * (-1)
-ELSE i.totallines
-END AS totallines, 
-CASE
-WHEN substr(d.docbasetype, 3) = 'C' THEN i.grandtotal * (-1)
-ELSE i.grandtotal
-END AS grandtotal, 
-CASE
-WHEN substr(d.docbasetype, 3) = 'C' THEN (-1)
-ELSE 1
-END AS multiplier, 
-CASE
-WHEN substr(d.docbasetype, 2, 1) = 'P' THEN (-1)
-ELSE 1
-END AS multiplierap, d.docbasetype
-FROM c_invoice i
-JOIN c_doctype d ON i.c_doctype_id = d.c_doctype_id]]></view>
+    <view name="C_INVOICE_V"><![CDATA[SELECT i.c_invoice_id, i.ad_client_id, i.ad_org_id, i.isactive, i.created, i.createdby, i.updated, i.updatedby, i.issotrx, i.documentno, i.docstatus, i.docaction, i.processing, i.processed, i.c_doctype_id, i.c_doctypetarget_id, i.c_order_id, i.description, i.salesrep_id, i.dateinvoiced, i.dateprinted, i.dateacct, i.c_bpartner_id, i.c_bpartner_location_id, i.ad_user_id, i.poreference, i.dateordered, i.c_currency_id, i.paymentrule, i.c_paymentterm_id, i.c_charge_id, i.m_pricelist_id, i.c_campaign_id, i.c_project_id, i.c_activity_id, i.isprinted, i.isdiscountprinted,  CASE WHEN substr(d.docbasetype, 3) = 'C' THEN i.chargeamt * (-1) ELSE i.chargeamt END AS chargeamt,  CASE WHEN substr(d.docbasetype, 3) = 'C' THEN i.totallines * (-1) ELSE i.totallines END AS totallines,  CASE WHEN substr(d.docbasetype, 3) = 'C' THEN i.grandtotal * (-1) ELSE i.grandtotal END AS grandtotal,  CASE WHEN substr(d.docbasetype, 3) = 'C' THEN (-1) ELSE 1 END AS multiplier,  CASE WHEN substr(d.docbasetype, 2, 1) = 'P' THEN (-1) ELSE 1 END AS multiplierap, d.docbasetype FROM c_invoice i JOIN c_doctype d ON i.c_doctype_id = d.c_doctype_id]]></view>
   </database>
--- a/src-db/database/model/views/C_INVOICE_V2.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/C_INVOICE_V2.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,22 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW C_INVOICE_V2">
-    <view name="C_INVOICE_V2"><![CDATA[SELECT i.c_invoice_id AS c_invoice_v2_id, i.c_invoice_id, i.ad_client_id, i.ad_org_id, i.isactive, i.created, i.createdby, i.updated, i.updatedby, i.issotrx, i.documentno, i.docstatus, i.docaction, i.isprinted, i.isdiscountprinted, i.processing, i.processed, i.c_doctype_id, i.c_doctypetarget_id, i.c_order_id, i.description, i.salesrep_id, i.dateinvoiced, i.dateprinted, i.dateacct, i.c_bpartner_id, i.c_bpartner_location_id, i.ad_user_id, b.c_bp_group_id, i.poreference, i.dateordered, i.c_currency_id, i.paymentrule, i.c_paymentterm_id, i.m_pricelist_id, i.c_campaign_id, i.c_project_id, i.c_activity_id, i.c_charge_id, 
-CASE substr(d.docbasetype, 3)
-WHEN 'C' THEN i.chargeamt * (-1)
-ELSE i.chargeamt
-END AS chargeamt, 
-CASE substr(d.docbasetype, 3)
-WHEN 'C' THEN i.totallines * (-1)
-ELSE i.totallines
-END AS totallines, 
-CASE substr(d.docbasetype, 3)
-WHEN 'C' THEN i.grandtotal * (-1)
-ELSE i.grandtotal
-END AS grandtotal, 
-CASE substr(d.docbasetype, 3)
-WHEN 'C' THEN (-1)
-ELSE 1
-END AS multiplier
-FROM c_invoice i, c_doctype d, c_bpartner b
-WHERE i.c_doctype_id = d.c_doctype_id AND i.c_bpartner_id = b.c_bpartner_id]]></view>
+    <view name="C_INVOICE_V2"><![CDATA[SELECT i.c_invoice_id AS c_invoice_v2_id, i.c_invoice_id, i.ad_client_id, i.ad_org_id, i.isactive, i.created, i.createdby, i.updated, i.updatedby, i.issotrx, i.documentno, i.docstatus, i.docaction, i.isprinted, i.isdiscountprinted, i.processing, i.processed, i.c_doctype_id, i.c_doctypetarget_id, i.c_order_id, i.description, i.salesrep_id, i.dateinvoiced, i.dateprinted, i.dateacct, i.c_bpartner_id, i.c_bpartner_location_id, i.ad_user_id, b.c_bp_group_id, i.poreference, i.dateordered, i.c_currency_id, i.paymentrule, i.c_paymentterm_id, i.m_pricelist_id, i.c_campaign_id, i.c_project_id, i.c_activity_id, i.c_charge_id,  CASE substr(d.docbasetype, 3) WHEN 'C' THEN i.chargeamt * (-1) ELSE i.chargeamt END AS chargeamt,  CASE substr(d.docbasetype, 3) WHEN 'C' THEN i.totallines * (-1) ELSE i.totallines END AS totallines,  CASE substr(d.docbasetype, 3) WHEN 'C' THEN i.grandtotal * (-1) ELSE i.grandtotal END AS grandtotal,  CASE substr(d.docbasetype, 3) WHEN 'C' THEN (-1) ELSE 1 END AS multiplier FROM c_invoice i, c_doctype d, c_bpartner b WHERE i.c_doctype_id = d.c_doctype_id AND i.c_bpartner_id = b.c_bpartner_id]]></view>
   </database>
--- a/src-db/database/model/views/C_ORDER_LINETAX_VT.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/C_ORDER_LINETAX_VT.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,39 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW C_ORDER_LINETAX_VT">
-    <view name="C_ORDER_LINETAX_VT"><![CDATA[((SELECT ol.ad_client_id, ol.ad_org_id, ol.isactive, ol.created, ol.createdby, ol.updated, ol.updatedby, uom.ad_language, ol.c_order_id, ol.c_orderline_id, ol.c_tax_id, ol.line, ol.qtyordered, uom.uomsymbol, COALESCE(COALESCE(pt.name, p.name), ol.description) AS name, 
-CASE
-WHEN COALESCE(pt.name, p.name) IS NOT NULL THEN ol.description
-ELSE NULL
-END AS description, COALESCE(pt.documentnote, p.documentnote) AS documentnote, p.upc, p.sku, p.value AS productvalue, ra.description AS resourcedescription, 
-CASE
-WHEN i.isdiscountprinted = 'Y' THEN ol.pricelist
-ELSE NULL
-END AS pricelist, 
-CASE
-WHEN i.isdiscountprinted = 'Y' AND ol.pricelist > ol.priceactual THEN (ol.pricelist - ol.priceactual) / ol.pricelist * 100
-ELSE NULL
-END AS discount, ol.priceactual, ol.linenetamt
-FROM c_orderline ol
-JOIN c_uom_trl uom ON ol.c_uom_id = uom.c_uom_id
-JOIN c_order i ON ol.c_order_id = i.c_order_id
-LEFT JOIN m_product p ON ol.m_product_id = p.m_product_id
-LEFT JOIN m_product_trl pt ON ol.m_product_id = pt.m_product_id AND uom.ad_language = pt.ad_language
-LEFT JOIN s_resourceassignment ra ON ol.s_resourceassignment_id = ra.s_resourceassignment_id
-UNION 
-SELECT ol.ad_client_id, ol.ad_org_id, ol.isactive, ol.created, ol.createdby, ol.updated, ol.updatedby, uom.ad_language, ol.c_order_id, ol.c_orderline_id, ol.c_tax_id, ol.line + b.line / 100 AS line, ol.qtyordered * b.bomqty AS qtyordered, uom.uomsymbol, COALESCE(pt.name, p.name) AS name, b.description, COALESCE(pt.documentnote, p.documentnote) AS documentnote, p.upc, p.sku, p.value AS productvalue, NULL AS resourcedescription, NULL AS pricelist, NULL AS discount, NULL AS priceactual, NULL AS linenetamt
-FROM m_product_bom b
-JOIN c_orderline ol ON b.m_product_id = ol.m_product_id
-JOIN m_product bp ON bp.m_product_id = ol.m_product_id AND bp.isbom = 'Y' AND bp.isverified = 'Y' AND bp.isinvoiceprintdetails = 'Y'
-JOIN m_product p ON b.m_productbom_id = p.m_product_id
-JOIN c_uom_trl uom ON p.c_uom_id = uom.c_uom_id
-JOIN m_product_trl pt ON b.m_productbom_id = pt.m_product_id AND uom.ad_language = pt.ad_language)
-UNION 
-SELECT o.ad_client_id, o.ad_org_id, o.isactive, o.created, o.createdby, o.updated, o.updatedby, l.ad_language, o.c_order_id, NULL AS c_orderline_id, NULL AS c_tax_id, NULL AS line, NULL AS qtyordered, NULL AS uomsymbol, NULL AS name, NULL AS description, NULL AS documentnote, NULL AS upc, NULL AS sku, NULL AS productvalue, NULL AS resourcedescription, NULL AS pricelist, NULL AS discount, NULL AS priceactual, NULL AS linenetamt
-FROM c_order o, ad_language l
-WHERE l.isbaselanguage = 'N' AND l.issystemlanguage = 'Y')
-UNION 
-SELECT ot.ad_client_id, ot.ad_org_id, ot.isactive, ot.created, ot.createdby, ot.updated, ot.updatedby, l.ad_language, ot.c_order_id, NULL AS c_orderline_id, ot.c_tax_id, NULL AS line, NULL AS qtyordered, NULL AS uomsymbol, t.name, NULL AS description, NULL AS documentnote, NULL AS upc, NULL AS sku, NULL AS productvalue, NULL AS resourcedescription, NULL AS pricelist, NULL AS discount, ot.taxbaseamt AS priceactual, ot.taxamt AS linenetamt
-FROM c_ordertax ot
-JOIN c_tax t ON ot.c_tax_id = t.c_tax_id, ad_language l
-WHERE l.isbaselanguage = 'N' AND l.issystemlanguage = 'Y']]></view>
+    <view name="C_ORDER_LINETAX_VT"><![CDATA[((SELECT ol.ad_client_id, ol.ad_org_id, ol.isactive, ol.created, ol.createdby, ol.updated, ol.updatedby, uom.ad_language, ol.c_order_id, ol.c_orderline_id, ol.c_tax_id, ol.line, ol.qtyordered, uom.uomsymbol, COALESCE(COALESCE(pt.name, p.name), ol.description) AS name,  CASE WHEN COALESCE(pt.name, p.name) IS NOT NULL THEN ol.description ELSE NULL END AS description, COALESCE(pt.documentnote, p.documentnote) AS documentnote, p.upc, p.sku, p.value AS productvalue, ra.description AS resourcedescription,  CASE WHEN i.isdiscountprinted = 'Y' THEN ol.pricelist ELSE NULL END AS pricelist,  CASE WHEN i.isdiscountprinted = 'Y' AND ol.pricelist > ol.priceactual THEN (ol.pricelist - ol.priceactual) / ol.pricelist * 100 ELSE NULL END AS discount, ol.priceactual, ol.linenetamt FROM c_orderline ol JOIN c_uom_trl uom ON ol.c_uom_id = uom.c_uom_id JOIN c_order i ON ol.c_order_id = i.c_order_id LEFT JOIN m_product p ON ol.m_product_id = p.m_product_id LEFT JOIN m_product_trl pt ON ol.m_product_id = pt.m_product_id AND uom.ad_language = pt.ad_language LEFT JOIN s_resourceassignment ra ON ol.s_resourceassignment_id = ra.s_resourceassignment_id UNION  SELECT ol.ad_client_id, ol.ad_org_id, ol.isactive, ol.created, ol.createdby, ol.updated, ol.updatedby, uom.ad_language, ol.c_order_id, ol.c_orderline_id, ol.c_tax_id, ol.line + b.line / 100 AS line, ol.qtyordered * b.bomqty AS qtyordered, uom.uomsymbol, COALESCE(pt.name, p.name) AS name, b.description, COALESCE(pt.documentnote, p.documentnote) AS documentnote, p.upc, p.sku, p.value AS productvalue, NULL AS resourcedescription, NULL AS pricelist, NULL AS discount, NULL AS priceactual, NULL AS linenetamt FROM m_product_bom b JOIN c_orderline ol ON b.m_product_id = ol.m_product_id JOIN m_product bp ON bp.m_product_id = ol.m_product_id AND bp.isbom = 'Y' AND bp.isverified = 'Y' AND bp.isinvoiceprintdetails = 'Y' JOIN m_product p ON b.m_productbom_id = p.m_product_id JOIN c_uom_trl uom ON p.c_uom_id = uom.c_uom_id JOIN m_product_trl pt ON b.m_productbom_id = pt.m_product_id AND uom.ad_language = pt.ad_language) UNION  SELECT o.ad_client_id, o.ad_org_id, o.isactive, o.created, o.createdby, o.updated, o.updatedby, l.ad_language, o.c_order_id, NULL AS c_orderline_id, NULL AS c_tax_id, NULL AS line, NULL AS qtyordered, NULL AS uomsymbol, NULL AS name, NULL AS description, NULL AS documentnote, NULL AS upc, NULL AS sku, NULL AS productvalue, NULL AS resourcedescription, NULL AS pricelist, NULL AS discount, NULL AS priceactual, NULL AS linenetamt FROM c_order o, ad_language l WHERE l.isbaselanguage = 'N' AND l.issystemlanguage = 'Y') UNION  SELECT ot.ad_client_id, ot.ad_org_id, ot.isactive, ot.created, ot.createdby, ot.updated, ot.updatedby, l.ad_language, ot.c_order_id, NULL AS c_orderline_id, ot.c_tax_id, NULL AS line, NULL AS qtyordered, NULL AS uomsymbol, t.name, NULL AS description, NULL AS documentnote, NULL AS upc, NULL AS sku, NULL AS productvalue, NULL AS resourcedescription, NULL AS pricelist, NULL AS discount, ot.taxbaseamt AS priceactual, ot.taxamt AS linenetamt FROM c_ordertax ot JOIN c_tax t ON ot.c_tax_id = t.c_tax_id, ad_language l WHERE l.isbaselanguage = 'N' AND l.issystemlanguage = 'Y']]></view>
   </database>
--- a/src-db/database/model/views/C_PERIODCONTROL_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/C_PERIODCONTROL_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,6 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW C_PERIODCONTROL_V">
-    <view name="C_PERIODCONTROL_V"><![CDATA[SELECT pc.c_periodcontrol_id AS c_periodcontrol_v_id, pc.ad_client_id, pc.ad_org_id, pc.isactive, pc.created, pc.createdby, pc.updated, pc.updatedby, pc.c_period_id, pc.docbasetype, pc.periodstatus, pc.periodaction, pc.processing, y.c_calendar_id, y.year, p.startdate, p.enddate, p.name
-FROM c_periodcontrol pc, c_period p, c_year y
-WHERE pc.c_period_id = p.c_period_id AND p.c_year_id = y.c_year_id]]></view>
+    <view name="C_PERIODCONTROL_V"><![CDATA[SELECT pc.c_periodcontrol_id AS c_periodcontrol_v_id, pc.ad_client_id, pc.ad_org_id, pc.isactive, pc.created, pc.createdby, pc.updated, pc.updatedby, pc.c_period_id, pc.docbasetype, pc.periodstatus, pc.periodaction, pc.processing, y.c_calendar_id, y.year, p.startdate, p.enddate, p.name FROM c_periodcontrol pc, c_period p, c_year y WHERE pc.c_period_id = p.c_period_id AND p.c_year_id = y.c_year_id]]></view>
   </database>
--- a/src-db/database/model/views/C_PROJECTPROPOSAL_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/C_PROJECTPROPOSAL_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,6 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW C_PROJECTPROPOSAL_V">
-    <view name="C_PROJECTPROPOSAL_V"><![CDATA[SELECT p.datesend AS fromdatesend, p.datesend AS todatesend, p.ad_client_id, p.ad_org_id, p.ad_user_id, p.c_bpartner_id, p.c_bpartner_location_id, p.c_project_id, p.c_projectproposal_id, p.issotrx, u.firstname, u.lastname, p.datesend, p.created, p.createdby, p.updated, p.updatedby
-FROM c_projectproposal p, ad_user u, c_project pr
-WHERE p.ad_user_id = u.ad_user_id AND p.c_project_id = pr.c_project_id AND p.isactive = 'Y' AND pr.isactive = 'Y']]></view>
+    <view name="C_PROJECTPROPOSAL_V"><![CDATA[SELECT p.datesend AS fromdatesend, p.datesend AS todatesend, p.ad_client_id, p.ad_org_id, p.ad_user_id, p.c_bpartner_id, p.c_bpartner_location_id, p.c_project_id, p.c_projectproposal_id, p.issotrx, u.firstname, u.lastname, p.datesend, p.created, p.createdby, p.updated, p.updatedby FROM c_projectproposal p, ad_user u, c_project pr WHERE p.ad_user_id = u.ad_user_id AND p.c_project_id = pr.c_project_id AND p.isactive = 'Y' AND pr.isactive = 'Y']]></view>
   </database>
--- a/src-db/database/model/views/C_RM_ORDER_PICK_EDIT_LINES.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/C_RM_ORDER_PICK_EDIT_LINES.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,37 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW C_RM_ORDER_PICK_EDIT_LINES">
-    <view name="C_RM_ORDER_PICK_EDIT_LINES"><![CDATA[SELECT COALESCE(il.m_inoutline_id, rol.c_orderline_id) AS c_rm_order_pick_edit_lines_id, COALESCE(rol.ad_client_id, il.ad_client_id) AS ad_client_id, COALESCE(rol.ad_org_id, il.ad_org_id) AS ad_org_id, COALESCE(rol.isactive, il.isactive) AS isactive, COALESCE(rol.createdby, il.createdby) AS createdby, COALESCE(rol.updatedby, il.updatedby) AS updatedby, COALESCE(rol.created, il.created) AS created, COALESCE(rol.updated, il.updated) AS updated, 
-CASE
-WHEN rol.c_orderline_id IS NOT NULL THEN 'Y'
-ELSE 'N'
-END AS ob_selected, il.m_inoutline_id, rol.c_order_id AS returnorderid, i.documentno AS inoutno, i.movementdate, COALESCE(rol.m_product_id, il.m_product_id) AS m_product_id, COALESCE(rol.m_attributesetinstance_id, il.m_attributesetinstance_id) AS m_attributesetinstance_id, il.movementqty, COALESCE(rol.c_uom_id, il.c_uom_id) AS c_uom_id, (-1) * rol.qtyordered AS returned, 
-CASE
-WHEN rol.c_orderline_id IS NOT NULL THEN 
-CASE rol.istaxincluded
-WHEN 'N' THEN rol.priceactual
-ELSE rol.gross_unit_price
-END
-ELSE 
-CASE pl.istaxincluded
-WHEN 'N' THEN ol.priceactual
-ELSE ol.gross_unit_price
-END
-END AS priceactual, rol.c_return_reason_id, o.documentno AS orderno, COALESCE(rol.issotrx, i.issotrx) AS issotrx, (-1) * retol.returnedqty AS returnedqty, COALESCE(rol.c_bpartner_id, i.c_bpartner_id) AS c_bpartner_id, COALESCE(rol.c_tax_id, ol.c_tax_id) AS c_tax_id, pl.istaxincluded, rol.c_orderline_id
-FROM m_inoutline il
-JOIN m_inout i ON il.m_inout_id = i.m_inout_id AND i.processed = 'Y' AND i.docstatus <> 'VO'
-JOIN c_doctype dt ON i.c_doctype_id = dt.c_doctype_id AND dt.isreturn = 'N'
-LEFT JOIN c_orderline ol ON il.c_orderline_id = ol.c_orderline_id
-LEFT JOIN c_order o ON ol.c_order_id = o.c_order_id
-LEFT JOIN m_pricelist pl ON o.m_pricelist_id = pl.m_pricelist_id
-FULL JOIN (SELECT ol2.c_orderline_id, ol2.ad_org_id, ol2.isactive, ol2.created, ol2.createdby, ol2.updated, ol2.updatedby, ol2.c_order_id, ol2.qtyordered, ol2.priceactual, ol2.c_return_reason_id, ol2.m_inoutline_id, o2.c_bpartner_id, o2.issotrx, o2.ad_client_id, ol2.m_product_id, ol2.m_attributesetinstance_id, ol2.c_uom_id, ol2.c_tax_id, pl2.istaxincluded, ol2.gross_unit_price
-FROM c_orderline ol2
-JOIN c_order o2 ON ol2.c_order_id = o2.c_order_id AND o2.processed = 'N'
-JOIN m_pricelist pl2 ON pl2.m_pricelist_id = o2.m_pricelist_id) rol ON rol.m_inoutline_id = il.m_inoutline_id
-LEFT JOIN (SELECT sum(ol3.qtyordered) AS returnedqty, ol3.m_inoutline_id
-FROM c_orderline ol3
-JOIN c_order o3 ON ol3.c_order_id = o3.c_order_id AND o3.processed = 'Y' AND o3.docstatus <> 'VO'
-WHERE ol3.m_inoutline_id IS NOT NULL
-GROUP BY ol3.m_inoutline_id) retol ON retol.m_inoutline_id = il.m_inoutline_id
-LEFT JOIN c_order ro ON ro.c_order_id = rol.c_order_id
-WHERE (COALESCE(retol.returnedqty, 0) + COALESCE(il.movementqty, rol.qtyordered)) <> 0 AND ol.c_order_discount_id IS NULL]]></view>
+    <view name="C_RM_ORDER_PICK_EDIT_LINES"><![CDATA[SELECT COALESCE(il.m_inoutline_id, rol.c_orderline_id) AS c_rm_order_pick_edit_lines_id, COALESCE(rol.ad_client_id, il.ad_client_id) AS ad_client_id, COALESCE(rol.ad_org_id, il.ad_org_id) AS ad_org_id, COALESCE(rol.isactive, il.isactive) AS isactive, COALESCE(rol.createdby, il.createdby) AS createdby, COALESCE(rol.updatedby, il.updatedby) AS updatedby, COALESCE(rol.created, il.created) AS created, COALESCE(rol.updated, il.updated) AS updated,  CASE WHEN rol.c_orderline_id IS NOT NULL THEN 'Y' ELSE 'N' END AS ob_selected, il.m_inoutline_id, rol.c_order_id AS returnorderid, i.documentno AS inoutno, i.movementdate, COALESCE(rol.m_product_id, il.m_product_id) AS m_product_id, COALESCE(rol.m_attributesetinstance_id, il.m_attributesetinstance_id) AS m_attributesetinstance_id, il.movementqty, COALESCE(rol.c_uom_id, il.c_uom_id) AS c_uom_id, (-1) * rol.qtyordered AS returned,  CASE WHEN rol.c_orderline_id IS NOT NULL THEN  CASE rol.istaxincluded WHEN 'N' THEN rol.priceactual ELSE rol.gross_unit_price END ELSE  CASE pl.istaxincluded WHEN 'N' THEN ol.priceactual ELSE ol.gross_unit_price END END AS priceactual, rol.c_return_reason_id, o.documentno AS orderno, COALESCE(rol.issotrx, i.issotrx) AS issotrx, (-1) * retol.returnedqty AS returnedqty, COALESCE(rol.c_bpartner_id, i.c_bpartner_id) AS c_bpartner_id, COALESCE(rol.c_tax_id, ol.c_tax_id) AS c_tax_id, pl.istaxincluded, rol.c_orderline_id FROM m_inoutline il JOIN m_inout i ON il.m_inout_id = i.m_inout_id AND i.processed = 'Y' AND i.docstatus <> 'VO' JOIN c_doctype dt ON i.c_doctype_id = dt.c_doctype_id AND dt.isreturn = 'N' LEFT JOIN c_orderline ol ON il.c_orderline_id = ol.c_orderline_id LEFT JOIN c_order o ON ol.c_order_id = o.c_order_id LEFT JOIN m_pricelist pl ON o.m_pricelist_id = pl.m_pricelist_id FULL JOIN (SELECT ol2.c_orderline_id, ol2.ad_org_id, ol2.isactive, ol2.created, ol2.createdby, ol2.updated, ol2.updatedby, ol2.c_order_id, ol2.qtyordered, ol2.priceactual, ol2.c_return_reason_id, ol2.m_inoutline_id, o2.c_bpartner_id, o2.issotrx, o2.ad_client_id, ol2.m_product_id, ol2.m_attributesetinstance_id, ol2.c_uom_id, ol2.c_tax_id, pl2.istaxincluded, ol2.gross_unit_price FROM c_orderline ol2 JOIN c_order o2 ON ol2.c_order_id = o2.c_order_id AND o2.processed = 'N' JOIN m_pricelist pl2 ON pl2.m_pricelist_id = o2.m_pricelist_id) rol ON rol.m_inoutline_id = il.m_inoutline_id LEFT JOIN (SELECT sum(ol3.qtyordered) AS returnedqty, ol3.m_inoutline_id FROM c_orderline ol3 JOIN c_order o3 ON ol3.c_order_id = o3.c_order_id AND o3.processed = 'Y' AND o3.docstatus <> 'VO' WHERE ol3.m_inoutline_id IS NOT NULL GROUP BY ol3.m_inoutline_id) retol ON retol.m_inoutline_id = il.m_inoutline_id LEFT JOIN c_order ro ON ro.c_order_id = rol.c_order_id WHERE (COALESCE(retol.returnedqty, 0) + COALESCE(il.movementqty, rol.qtyordered)) <> 0 AND ol.c_order_discount_id IS NULL]]></view>
   </database>
--- a/src-db/database/model/views/FIN_PAYMENT_DETAIL_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/FIN_PAYMENT_DETAIL_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,13 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW FIN_PAYMENT_DETAIL_V">
-    <view name="FIN_PAYMENT_DETAIL_V"><![CDATA[SELECT psd.fin_payment_scheduledetail_id AS fin_payment_detail_v_id, psd.ad_client_id, psd.ad_org_id, psd.isactive, psd.created, psd.createdby, psd.updated, psd.updatedby, psi.fin_payment_schedule_id AS fin_payment_sched_inv_v_id, pso.fin_payment_schedule_id AS fin_payment_sched_ord_v_id, i.documentno AS invoiceno, o.documentno AS orderno, p.documentno AS paymentno, pd.fin_payment_id, COALESCE(psi.duedate, pso.duedate) AS duedate, COALESCE(i.grandtotal, o.grandtotal) AS invoicedamt, COALESCE(psi.amount, pso.amount) AS expected, psd.amount AS paidamt, p.c_bpartner_id, p.fin_paymentmethod_id, p.fin_financial_account_id, p.c_currency_id, p.paymentdate, gli.name AS glitemname, pd.writeoffamt, fa.c_currency_id AS finacc_currency_id, p.finacc_txn_convert_rate, psd.amount * p.finacc_txn_convert_rate AS paidconverted, COALESCE(psi.amount, pso.amount) * p.finacc_txn_convert_rate AS expectedconverted, psd.iscanceled, psd.c_bpartner_id AS c_bpartner_id_dim, psd.c_activity_id, psd.m_product_id, psd.c_campaign_id, psd.c_project_id, psd.c_salesregion_id, p.status
-FROM fin_payment p
-LEFT JOIN fin_financial_account fa ON p.fin_financial_account_id = fa.fin_financial_account_id, fin_payment_detail pd
-JOIN fin_payment_scheduledetail psd ON pd.fin_payment_detail_id = psd.fin_payment_detail_id
-LEFT JOIN fin_payment_schedule psi ON psd.fin_payment_schedule_invoice = psi.fin_payment_schedule_id
-LEFT JOIN c_invoice i ON psi.c_invoice_id = i.c_invoice_id
-LEFT JOIN fin_payment_schedule pso ON psd.fin_payment_schedule_order = pso.fin_payment_schedule_id
-LEFT JOIN c_order o ON pso.c_order_id = o.c_order_id
-LEFT JOIN c_glitem gli ON pd.c_glitem_id = gli.c_glitem_id
-WHERE p.fin_payment_id = pd.fin_payment_id]]></view>
+    <view name="FIN_PAYMENT_DETAIL_V"><![CDATA[SELECT psd.fin_payment_scheduledetail_id AS fin_payment_detail_v_id, psd.ad_client_id, psd.ad_org_id, psd.isactive, psd.created, psd.createdby, psd.updated, psd.updatedby, psi.fin_payment_schedule_id AS fin_payment_sched_inv_v_id, pso.fin_payment_schedule_id AS fin_payment_sched_ord_v_id, i.documentno AS invoiceno, o.documentno AS orderno, p.documentno AS paymentno, pd.fin_payment_id, COALESCE(psi.duedate, pso.duedate) AS duedate, COALESCE(i.grandtotal, o.grandtotal) AS invoicedamt, COALESCE(psi.amount, pso.amount) AS expected, psd.amount AS paidamt, p.c_bpartner_id, p.fin_paymentmethod_id, p.fin_financial_account_id, p.c_currency_id, p.paymentdate, gli.name AS glitemname, pd.writeoffamt, fa.c_currency_id AS finacc_currency_id, p.finacc_txn_convert_rate, psd.amount * p.finacc_txn_convert_rate AS paidconverted, COALESCE(psi.amount, pso.amount) * p.finacc_txn_convert_rate AS expectedconverted, psd.iscanceled, psd.c_bpartner_id AS c_bpartner_id_dim, psd.c_activity_id, psd.m_product_id, psd.c_campaign_id, psd.c_project_id, psd.c_salesregion_id, p.status FROM fin_payment p LEFT JOIN fin_financial_account fa ON p.fin_financial_account_id = fa.fin_financial_account_id, fin_payment_detail pd JOIN fin_payment_scheduledetail psd ON pd.fin_payment_detail_id = psd.fin_payment_detail_id LEFT JOIN fin_payment_schedule psi ON psd.fin_payment_schedule_invoice = psi.fin_payment_schedule_id LEFT JOIN c_invoice i ON psi.c_invoice_id = i.c_invoice_id LEFT JOIN fin_payment_schedule pso ON psd.fin_payment_schedule_order = pso.fin_payment_schedule_id LEFT JOIN c_order o ON pso.c_order_id = o.c_order_id LEFT JOIN c_glitem gli ON pd.c_glitem_id = gli.c_glitem_id WHERE p.fin_payment_id = pd.fin_payment_id]]></view>
   </database>
--- a/src-db/database/model/views/FIN_PAYMENT_EXEC_HISTORY_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/FIN_PAYMENT_EXEC_HISTORY_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,6 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW FIN_PAYMENT_EXEC_HISTORY_V">
-    <view name="FIN_PAYMENT_EXEC_HISTORY_V"><![CDATA[SELECT prp.fin_payment_run_payment_id AS fin_payment_exec_history_v_id, prp.fin_payment_id, prp.ad_client_id, prp.ad_org_id, prp.created, prp.createdby, prp.updated, prp.updatedby, prp.isactive, prp.created AS executiondate, pr.fin_payment_run_id, pr.message AS prun_message, pr.status AS prun_status, pr.run_source AS prun_source, prp.result AS paymentexec_result, prp.message AS paymentexec_message
-FROM fin_payment_run pr
-JOIN fin_payment_run_payment prp ON pr.fin_payment_run_id = prp.fin_payment_run_id]]></view>
+    <view name="FIN_PAYMENT_EXEC_HISTORY_V"><![CDATA[SELECT prp.fin_payment_run_payment_id AS fin_payment_exec_history_v_id, prp.fin_payment_id, prp.ad_client_id, prp.ad_org_id, prp.created, prp.createdby, prp.updated, prp.updatedby, prp.isactive, prp.created AS executiondate, pr.fin_payment_run_id, pr.message AS prun_message, pr.status AS prun_status, pr.run_source AS prun_source, prp.result AS paymentexec_result, prp.message AS paymentexec_message FROM fin_payment_run pr JOIN fin_payment_run_payment prp ON pr.fin_payment_run_id = prp.fin_payment_run_id]]></view>
   </database>
--- a/src-db/database/model/views/FIN_PAYMENT_PROP_DETAIL_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/FIN_PAYMENT_PROP_DETAIL_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,12 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW FIN_PAYMENT_PROP_DETAIL_V">
-    <view name="FIN_PAYMENT_PROP_DETAIL_V"><![CDATA[SELECT ppd.fin_payment_prop_detail_id AS fin_payment_prop_detail_v_id, ppd.ad_client_id, ppd.ad_org_id, ppd.isactive, ppd.created, ppd.createdby, ppd.updated, ppd.updatedby, psd.fin_payment_scheduledetail_id, ppd.fin_payment_proposal_id, i.documentno AS invoiceno, o.documentno AS orderno, p.documentno AS paymentno, pd.fin_payment_id, COALESCE(psi.duedate, pso.duedate) AS duedate, COALESCE(i.grandtotal, o.grandtotal) AS invoicedamt, COALESCE(psi.expected, pso.expected) AS expected, ppd.amount AS paidamt, COALESCE(p.c_bpartner_id, i.c_bpartner_id, o.c_bpartner_id) AS c_bpartner_id, ppd.writeoffamt
-FROM fin_payment_prop_detail ppd, fin_payment_scheduledetail psd
-LEFT JOIN fin_payment_sched_inv_v psi ON psd.fin_payment_schedule_invoice = psi.fin_payment_sched_inv_v_id
-LEFT JOIN c_invoice i ON psi.c_invoice_id = i.c_invoice_id
-LEFT JOIN fin_payment_sched_ord_v pso ON psd.fin_payment_schedule_order = pso.fin_payment_sched_ord_v_id
-LEFT JOIN c_order o ON pso.c_order_id = o.c_order_id
-LEFT JOIN fin_payment_detail pd ON psd.fin_payment_detail_id = pd.fin_payment_detail_id
-LEFT JOIN fin_payment p ON pd.fin_payment_id = p.fin_payment_id
-WHERE ppd.fin_payment_scheduledetail_id = psd.fin_payment_scheduledetail_id]]></view>
+    <view name="FIN_PAYMENT_PROP_DETAIL_V"><![CDATA[SELECT ppd.fin_payment_prop_detail_id AS fin_payment_prop_detail_v_id, ppd.ad_client_id, ppd.ad_org_id, ppd.isactive, ppd.created, ppd.createdby, ppd.updated, ppd.updatedby, psd.fin_payment_scheduledetail_id, ppd.fin_payment_proposal_id, i.documentno AS invoiceno, o.documentno AS orderno, p.documentno AS paymentno, pd.fin_payment_id, COALESCE(psi.duedate, pso.duedate) AS duedate, COALESCE(i.grandtotal, o.grandtotal) AS invoicedamt, COALESCE(psi.expected, pso.expected) AS expected, ppd.amount AS paidamt, COALESCE(p.c_bpartner_id, i.c_bpartner_id, o.c_bpartner_id) AS c_bpartner_id, ppd.writeoffamt FROM fin_payment_prop_detail ppd, fin_payment_scheduledetail psd LEFT JOIN fin_payment_sched_inv_v psi ON psd.fin_payment_schedule_invoice = psi.fin_payment_sched_inv_v_id LEFT JOIN c_invoice i ON psi.c_invoice_id = i.c_invoice_id LEFT JOIN fin_payment_sched_ord_v pso ON psd.fin_payment_schedule_order = pso.fin_payment_sched_ord_v_id LEFT JOIN c_order o ON pso.c_order_id = o.c_order_id LEFT JOIN fin_payment_detail pd ON psd.fin_payment_detail_id = pd.fin_payment_detail_id LEFT JOIN fin_payment p ON pd.fin_payment_id = p.fin_payment_id WHERE ppd.fin_payment_scheduledetail_id = psd.fin_payment_scheduledetail_id]]></view>
   </database>
--- a/src-db/database/model/views/FIN_PAYMENT_SCHED_INV_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/FIN_PAYMENT_SCHED_INV_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,23 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW FIN_PAYMENT_SCHED_INV_V">
-    <view name="FIN_PAYMENT_SCHED_INV_V"><![CDATA[SELECT ps.fin_payment_schedule_id AS fin_payment_sched_inv_v_id, ps.ad_client_id, ps.ad_org_id, ps.isactive, ps.created, ps.createdby, ps.updated, ps.updatedby, ps.c_invoice_id, ps.c_order_id, ps.duedate, ps.fin_paymentmethod_id, ps.amount AS expected, ps.paidamt AS received, ps.outstandingamt AS outstanding, ps.c_currency_id, (SELECT max(p.paymentdate) AS max
-FROM fin_payment p
-LEFT JOIN fin_payment_detail pd ON pd.fin_payment_id = p.fin_payment_id
-LEFT JOIN fin_payment_scheduledetail psd ON pd.fin_payment_detail_id = psd.fin_payment_detail_id
-WHERE ps.c_invoice_id IS NOT NULL AND psd.fin_payment_schedule_invoice = ps.fin_payment_schedule_id) AS lastpayment, (SELECT count(*) AS count
-FROM fin_payment_detail pd, fin_payment_scheduledetail psd
-WHERE pd.fin_payment_detail_id = psd.fin_payment_detail_id AND ps.c_invoice_id IS NOT NULL AND psd.fin_payment_schedule_invoice = ps.fin_payment_schedule_id) AS numberofpayments, ps.fin_payment_priority_id, ps.update_payment_plan, to_char('Y') AS ob_selected, (SELECT 
-CASE
-WHEN to_number(max(pdv.paymentdate) - min(ops.duedate)) > 0 THEN to_number(max(pdv.paymentdate) - min(ops.duedate))
-ELSE 0
-END AS "case"
-FROM fin_orig_paym_scheddetail opsd
-LEFT JOIN fin_orig_payment_schedule ops ON opsd.fin_orig_payment_schedule_id = ops.fin_orig_payment_schedule_id
-LEFT JOIN fin_payment_scheduledetail psd ON psd.fin_payment_scheduledetail_id = opsd.fin_payment_scheduledetail_id
-LEFT JOIN fin_payment_detail_v pdv ON pdv.fin_payment_detail_v_id = psd.fin_payment_scheduledetail_id
-WHERE psd.fin_payment_schedule_invoice = ps.fin_payment_schedule_id) AS daysoverdue, COALESCE((SELECT sum(psd.amount) AS sum
-FROM fin_payment_scheduledetail psd, fin_payment_detail pd
-LEFT JOIN fin_payment p ON pd.fin_payment_id = p.fin_payment_id
-WHERE psd.fin_payment_schedule_invoice = ps.fin_payment_schedule_id AND psd.fin_payment_detail_id = pd.fin_payment_detail_id AND p.status = 'RPAE'), 0) AS awaiting_execution, 'Y' AS em_aprm_modif_paym_sched, 'Y' AS em_aprm_modif_paym_out_sched
-FROM fin_payment_schedule ps]]></view>
+    <view name="FIN_PAYMENT_SCHED_INV_V"><![CDATA[SELECT ps.fin_payment_schedule_id AS fin_payment_sched_inv_v_id, ps.ad_client_id, ps.ad_org_id, ps.isactive, ps.created, ps.createdby, ps.updated, ps.updatedby, ps.c_invoice_id, ps.c_order_id, ps.duedate, ps.fin_paymentmethod_id, ps.amount AS expected, ps.paidamt AS received, ps.outstandingamt AS outstanding, ps.c_currency_id, (SELECT max(p.paymentdate) AS max FROM fin_payment p LEFT JOIN fin_payment_detail pd ON pd.fin_payment_id = p.fin_payment_id LEFT JOIN fin_payment_scheduledetail psd ON pd.fin_payment_detail_id = psd.fin_payment_detail_id WHERE ps.c_invoice_id IS NOT NULL AND psd.fin_payment_schedule_invoice = ps.fin_payment_schedule_id) AS lastpayment, (SELECT count(*) AS count FROM fin_payment_detail pd, fin_payment_scheduledetail psd WHERE pd.fin_payment_detail_id = psd.fin_payment_detail_id AND ps.c_invoice_id IS NOT NULL AND psd.fin_payment_schedule_invoice = ps.fin_payment_schedule_id) AS numberofpayments, ps.fin_payment_priority_id, ps.update_payment_plan, to_char('Y') AS ob_selected, (SELECT  CASE WHEN to_number(max(pdv.paymentdate) - min(ops.duedate)) > 0 THEN to_number(max(pdv.paymentdate) - min(ops.duedate)) ELSE 0 END AS "case" FROM fin_orig_paym_scheddetail opsd LEFT JOIN fin_orig_payment_schedule ops ON opsd.fin_orig_payment_schedule_id = ops.fin_orig_payment_schedule_id LEFT JOIN fin_payment_scheduledetail psd ON psd.fin_payment_scheduledetail_id = opsd.fin_payment_scheduledetail_id LEFT JOIN fin_payment_detail_v pdv ON pdv.fin_payment_detail_v_id = psd.fin_payment_scheduledetail_id WHERE psd.fin_payment_schedule_invoice = ps.fin_payment_schedule_id) AS daysoverdue, COALESCE((SELECT sum(psd.amount) AS sum FROM fin_payment_scheduledetail psd, fin_payment_detail pd LEFT JOIN fin_payment p ON pd.fin_payment_id = p.fin_payment_id WHERE psd.fin_payment_schedule_invoice = ps.fin_payment_schedule_id AND psd.fin_payment_detail_id = pd.fin_payment_detail_id AND p.status = 'RPAE'), 0) AS awaiting_execution, 'Y' AS em_aprm_modif_paym_sched, 'Y' AS em_aprm_modif_paym_out_sched FROM fin_payment_schedule ps]]></view>
   </database>
--- a/src-db/database/model/views/FIN_PAYMENT_SCHED_ORD_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/FIN_PAYMENT_SCHED_ORD_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,11 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW FIN_PAYMENT_SCHED_ORD_V">
-    <view name="FIN_PAYMENT_SCHED_ORD_V"><![CDATA[SELECT ps.fin_payment_schedule_id AS fin_payment_sched_ord_v_id, ps.ad_client_id, ps.ad_org_id, ps.isactive, ps.created, ps.createdby, ps.updated, ps.updatedby, ps.c_invoice_id, ps.c_order_id, ps.duedate, ps.fin_paymentmethod_id, ps.amount AS expected, ps.paidamt AS received, ps.outstandingamt AS outstanding, ps.c_currency_id, (SELECT max(p.paymentdate) AS max
-FROM fin_payment p
-LEFT JOIN fin_payment_detail pd ON pd.fin_payment_id = p.fin_payment_id
-LEFT JOIN fin_payment_scheduledetail psd ON pd.fin_payment_detail_id = psd.fin_payment_detail_id
-WHERE ps.c_order_id IS NOT NULL AND psd.fin_payment_schedule_order = ps.fin_payment_schedule_id) AS lastpayment, (SELECT count(*) AS count
-FROM fin_payment_detail pd, fin_payment_scheduledetail psd
-WHERE pd.fin_payment_detail_id = psd.fin_payment_detail_id AND ps.c_order_id IS NOT NULL AND psd.fin_payment_schedule_order = ps.fin_payment_schedule_id) AS numberofpayments, ps.fin_payment_priority_id, ps.update_payment_plan
-FROM fin_payment_schedule ps]]></view>
+    <view name="FIN_PAYMENT_SCHED_ORD_V"><![CDATA[SELECT ps.fin_payment_schedule_id AS fin_payment_sched_ord_v_id, ps.ad_client_id, ps.ad_org_id, ps.isactive, ps.created, ps.createdby, ps.updated, ps.updatedby, ps.c_invoice_id, ps.c_order_id, ps.duedate, ps.fin_paymentmethod_id, ps.amount AS expected, ps.paidamt AS received, ps.outstandingamt AS outstanding, ps.c_currency_id, (SELECT max(p.paymentdate) AS max FROM fin_payment p LEFT JOIN fin_payment_detail pd ON pd.fin_payment_id = p.fin_payment_id LEFT JOIN fin_payment_scheduledetail psd ON pd.fin_payment_detail_id = psd.fin_payment_detail_id WHERE ps.c_order_id IS NOT NULL AND psd.fin_payment_schedule_order = ps.fin_payment_schedule_id) AS lastpayment, (SELECT count(*) AS count FROM fin_payment_detail pd, fin_payment_scheduledetail psd WHERE pd.fin_payment_detail_id = psd.fin_payment_detail_id AND ps.c_order_id IS NOT NULL AND psd.fin_payment_schedule_order = ps.fin_payment_schedule_id) AS numberofpayments, ps.fin_payment_priority_id, ps.update_payment_plan FROM fin_payment_schedule ps]]></view>
   </database>
--- a/src-db/database/model/views/FIN_RECONCILIATIONLINE_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/FIN_RECONCILIATIONLINE_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,6 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW FIN_RECONCILIATIONLINE_V">
-    <view name="FIN_RECONCILIATIONLINE_V"><![CDATA[SELECT fin_finacc_transaction.fin_finacc_transaction_id AS fin_reconciliationline_v_id, fin_finacc_transaction.fin_finacc_transaction_id, fin_finacc_transaction.ad_client_id, fin_finacc_transaction.ad_org_id, fin_finacc_transaction.created, fin_finacc_transaction.createdby, fin_finacc_transaction.updated, fin_finacc_transaction.updatedby, fin_finacc_transaction.isactive, fin_finacc_transaction.fin_payment_id, fin_finacc_transaction.c_currency_id, fin_finacc_transaction.fin_financial_account_id, fin_finacc_transaction.dateacct, fin_finacc_transaction.c_glitem_id, fin_finacc_transaction.paymentamt, fin_finacc_transaction.depositamt, fin_finacc_transaction.c_project_id, fin_finacc_transaction.c_campaign_id, fin_finacc_transaction.c_activity_id, fin_finacc_transaction.user1_id, fin_finacc_transaction.user2_id, fin_finacc_transaction.trxtype, fin_finacc_transaction.statementdate, fin_finacc_transaction.description, fin_finacc_transaction.fin_reconciliation_id, fin_bankstatementline.fin_bankstatementline_id
-FROM fin_finacc_transaction
-LEFT JOIN fin_bankstatementline ON fin_finacc_transaction.fin_finacc_transaction_id = fin_bankstatementline.fin_finacc_transaction_id]]></view>
+    <view name="FIN_RECONCILIATIONLINE_V"><![CDATA[SELECT fin_finacc_transaction.fin_finacc_transaction_id AS fin_reconciliationline_v_id, fin_finacc_transaction.fin_finacc_transaction_id, fin_finacc_transaction.ad_client_id, fin_finacc_transaction.ad_org_id, fin_finacc_transaction.created, fin_finacc_transaction.createdby, fin_finacc_transaction.updated, fin_finacc_transaction.updatedby, fin_finacc_transaction.isactive, fin_finacc_transaction.fin_payment_id, fin_finacc_transaction.c_currency_id, fin_finacc_transaction.fin_financial_account_id, fin_finacc_transaction.dateacct, fin_finacc_transaction.c_glitem_id, fin_finacc_transaction.paymentamt, fin_finacc_transaction.depositamt, fin_finacc_transaction.c_project_id, fin_finacc_transaction.c_campaign_id, fin_finacc_transaction.c_activity_id, fin_finacc_transaction.user1_id, fin_finacc_transaction.user2_id, fin_finacc_transaction.trxtype, fin_finacc_transaction.statementdate, fin_finacc_transaction.description, fin_finacc_transaction.fin_reconciliation_id, fin_bankstatementline.fin_bankstatementline_id FROM fin_finacc_transaction LEFT JOIN fin_bankstatementline ON fin_finacc_transaction.fin_finacc_transaction_id = fin_bankstatementline.fin_finacc_transaction_id]]></view>
   </database>
--- a/src-db/database/model/views/MA_PROCESSPLAN_TOTALIZED.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/MA_PROCESSPLAN_TOTALIZED.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,22 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW MA_PROCESSPLAN_TOTALIZED">
-    <view name="MA_PROCESSPLAN_TOTALIZED"><![CDATA[SELECT ma_processplan_version.ma_processplan_id, ma_processplan_version.ma_processplan_version_id, m_product.m_product_id AS produced, sp1.qty AS proqty, sp2.m_product_id AS dependantproduct, sp2.qty AS depqty
-FROM m_product, ma_processplan, ma_processplan_version, (SELECT ma_sequence.ma_processplan_version_id, ma_sequenceproduct.m_product_id, sum(
-CASE ma_sequenceproduct.productiontype
-WHEN '+' THEN ma_sequenceproduct.quantity * ma_sequence.multiplier
-WHEN '-' THEN ma_sequenceproduct.quantity * ma_sequence.multiplier * (-1)
-ELSE NULL
-END) AS qty
-FROM ma_sequence, ma_sequenceproduct
-WHERE ma_sequence.ma_sequence_id = ma_sequenceproduct.ma_sequence_id AND ma_sequence.isactive = 'Y' AND ma_sequenceproduct.isactive = 'Y'
-GROUP BY ma_sequence.ma_processplan_version_id, ma_sequenceproduct.m_product_id) sp1, (SELECT ma_sequence.ma_processplan_version_id, ma_sequenceproduct.m_product_id, sum(
-CASE ma_sequenceproduct.productiontype
-WHEN '+' THEN ma_sequenceproduct.quantity * ma_sequence.multiplier
-WHEN '-' THEN ma_sequenceproduct.quantity * ma_sequence.multiplier * (-1)
-ELSE NULL
-END) AS qty
-FROM ma_sequence, ma_sequenceproduct
-WHERE ma_sequence.ma_sequence_id = ma_sequenceproduct.ma_sequence_id AND ma_sequence.isactive = 'Y' AND ma_sequenceproduct.isactive = 'Y'
-GROUP BY ma_sequence.ma_processplan_version_id, ma_sequenceproduct.m_product_id) sp2
-WHERE ma_processplan.ma_processplan_id = ma_processplan_version.ma_processplan_id AND m_product.ma_processplan_id = ma_processplan_version.ma_processplan_id AND ma_processplan.isactive = 'Y' AND ma_processplan_version.isactive = 'Y' AND ma_processplan_version.datefrom <= now() AND ma_processplan_version.dateto > now() AND ma_processplan_version.ma_processplan_version_id = sp1.ma_processplan_version_id AND ma_processplan_version.ma_processplan_version_id = sp2.ma_processplan_version_id AND sp1.m_product_id = m_product.m_product_id AND sp2.m_product_id <> m_product.m_product_id AND sp1.qty > 0 AND sp2.qty <> 0]]></view>
+    <view name="MA_PROCESSPLAN_TOTALIZED"><![CDATA[SELECT ma_processplan_version.ma_processplan_id, ma_processplan_version.ma_processplan_version_id, m_product.m_product_id AS produced, sp1.qty AS proqty, sp2.m_product_id AS dependantproduct, sp2.qty AS depqty FROM m_product, ma_processplan, ma_processplan_version, (SELECT ma_sequence.ma_processplan_version_id, ma_sequenceproduct.m_product_id, sum(CASE ma_sequenceproduct.productiontype WHEN '+' THEN ma_sequenceproduct.quantity * ma_sequence.multiplier WHEN '-' THEN ma_sequenceproduct.quantity * ma_sequence.multiplier * (-1) ELSE NULL END) AS qty FROM ma_sequence, ma_sequenceproduct WHERE ma_sequence.ma_sequence_id = ma_sequenceproduct.ma_sequence_id AND ma_sequence.isactive = 'Y' AND ma_sequenceproduct.isactive = 'Y' GROUP BY ma_sequence.ma_processplan_version_id, ma_sequenceproduct.m_product_id) sp1, (SELECT ma_sequence.ma_processplan_version_id, ma_sequenceproduct.m_product_id, sum(CASE ma_sequenceproduct.productiontype WHEN '+' THEN ma_sequenceproduct.quantity * ma_sequence.multiplier WHEN '-' THEN ma_sequenceproduct.quantity * ma_sequence.multiplier * (-1) ELSE NULL END) AS qty FROM ma_sequence, ma_sequenceproduct WHERE ma_sequence.ma_sequence_id = ma_sequenceproduct.ma_sequence_id AND ma_sequence.isactive = 'Y' AND ma_sequenceproduct.isactive = 'Y' GROUP BY ma_sequence.ma_processplan_version_id, ma_sequenceproduct.m_product_id) sp2 WHERE ma_processplan.ma_processplan_id = ma_processplan_version.ma_processplan_id AND m_product.ma_processplan_id = ma_processplan_version.ma_processplan_id AND ma_processplan.isactive = 'Y' AND ma_processplan_version.isactive = 'Y' AND ma_processplan_version.datefrom <= now() AND ma_processplan_version.dateto > now() AND ma_processplan_version.ma_processplan_version_id = sp1.ma_processplan_version_id AND ma_processplan_version.ma_processplan_version_id = sp2.ma_processplan_version_id AND sp1.m_product_id = m_product.m_product_id AND sp2.m_product_id <> m_product.m_product_id AND sp1.qty > 0 AND sp2.qty <> 0]]></view>
   </database>
--- a/src-db/database/model/views/M_COSTING_RULE_PRODUCT_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/M_COSTING_RULE_PRODUCT_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,6 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW M_COSTING_RULE_PRODUCT_V">
-    <view name="M_COSTING_RULE_PRODUCT_V"><![CDATA[SELECT cr.m_costing_rule_id || pr.m_product_id AS m_costing_rule_product_v_id, cr.ad_client_id, cr.ad_org_id, cr.isactive, cr.created, cr.createdby, cr.updated, cr.updatedby, cr.m_costing_rule_id, cr.m_product_id AS apply_product_id, cr.m_costing_algorithm_id, pr.m_product_id, cr.m_product_category_id, cr.datefrom, cr.dateto, cr.org_dimension, cr.warehouse_dimension, cr.isvalidated
-FROM m_costing_rule cr
-LEFT JOIN m_product pr ON pr.ad_client_id = cr.ad_client_id AND ad_org_isinnaturaltree(pr.ad_org_id, cr.ad_org_id, cr.ad_client_id) = 'Y' AND pr.producttype = 'I' AND pr.isstocked = 'Y']]></view>
+    <view name="M_COSTING_RULE_PRODUCT_V"><![CDATA[SELECT cr.m_costing_rule_id || pr.m_product_id AS m_costing_rule_product_v_id, cr.ad_client_id, cr.ad_org_id, cr.isactive, cr.created, cr.createdby, cr.updated, cr.updatedby, cr.m_costing_rule_id, cr.m_product_id AS apply_product_id, cr.m_costing_algorithm_id, pr.m_product_id, cr.m_product_category_id, cr.datefrom, cr.dateto, cr.org_dimension, cr.warehouse_dimension, cr.isvalidated FROM m_costing_rule cr LEFT JOIN m_product pr ON pr.ad_client_id = cr.ad_client_id AND ad_org_isinnaturaltree(pr.ad_org_id, cr.ad_org_id, cr.ad_client_id) = 'Y' AND pr.producttype = 'I' AND pr.isstocked = 'Y']]></view>
   </database>
--- a/src-db/database/model/views/M_INOUT_CANDIDATE_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/M_INOUT_CANDIDATE_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,10 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW M_INOUT_CANDIDATE_V">
-    <view name="M_INOUT_CANDIDATE_V"><![CDATA[SELECT o.ad_client_id, o.ad_org_id, o.c_bpartner_id, o.c_order_id, o.documentno, o.dateordered, o.c_doctype_id, o.totallines AS amountlines, sum((l.qtyordered - l.qtydelivered) * l.priceactual) AS totallines
-FROM c_order o
-JOIN c_orderline l ON o.c_order_id = l.c_order_id
-WHERE o.docstatus = 'CO' AND o.isdelivered = 'N' AND (o.c_doctype_id IN (SELECT c_doctype.c_doctype_id
-FROM c_doctype
-WHERE c_doctype.docbasetype = 'SOO' AND (c_doctype.docsubtypeso NOT IN ('ON', 'OB', 'WR')))) AND l.qtyordered <> l.qtydelivered AND l.directship = 'N' AND l.m_product_id IS NOT NULL
-GROUP BY o.ad_client_id, o.ad_org_id, o.c_bpartner_id, o.c_order_id, o.documentno, o.dateordered, o.totallines, o.c_doctype_id]]></view>
+    <view name="M_INOUT_CANDIDATE_V"><![CDATA[SELECT o.ad_client_id, o.ad_org_id, o.c_bpartner_id, o.c_order_id, o.documentno, o.dateordered, o.c_doctype_id, o.totallines AS amountlines, sum((l.qtyordered - l.qtydelivered) * l.priceactual) AS totallines FROM c_order o JOIN c_orderline l ON o.c_order_id = l.c_order_id WHERE o.docstatus = 'CO' AND o.isdelivered = 'N' AND (o.c_doctype_id IN (SELECT c_doctype.c_doctype_id FROM c_doctype WHERE c_doctype.docbasetype = 'SOO' AND (c_doctype.docsubtypeso NOT IN ('ON', 'OB', 'WR')))) AND l.qtyordered <> l.qtydelivered AND l.directship = 'N' AND l.m_product_id IS NOT NULL GROUP BY o.ad_client_id, o.ad_org_id, o.c_bpartner_id, o.c_order_id, o.documentno, o.dateordered, o.totallines, o.c_doctype_id]]></view>
   </database>
--- a/src-db/database/model/views/M_PRODUCT_PRICE_WAREHOUSE_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/M_PRODUCT_PRICE_WAREHOUSE_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,24 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW M_PRODUCT_PRICE_WAREHOUSE_V">
-    <view name="M_PRODUCT_PRICE_WAREHOUSE_V"><![CDATA[SELECT COALESCE(w.m_warehouse_id, '-') || pp.m_productprice_id AS m_product_price_warehouse_v_id, p.ad_client_id, p.ad_org_id, p.isactive, p.updated, p.updatedby, p.created, p.createdby, p.m_product_id, w.m_warehouse_id, pp.m_productprice_id, 
-CASE
-WHEN p.producttype <> 'I' OR p.isstocked = 'N' THEN 99999
-ELSE COALESCE(pwq.qtyonhand - pwq.qtyreserved, 0)
-END AS qty_available, 
-CASE
-WHEN p.producttype <> 'I' OR p.isstocked = 'N' THEN 99999
-ELSE COALESCE(pwq.qtyonhand, 0)
-END AS qty_onhand, 
-CASE
-WHEN p.producttype <> 'I' OR p.isstocked = 'N' THEN 0
-ELSE COALESCE(pwq.qtyreserved, 0)
-END AS qty_reserved, 
-CASE
-WHEN p.producttype <> 'I' OR p.isstocked = 'N' THEN 0
-ELSE COALESCE(pwq.qtyordered, 0)
-END AS qty_ordered, pp.pricelist, pp.pricestd, pp.pricelimit
-FROM m_productprice pp
-LEFT JOIN m_warehouse w ON pp.ad_client_id = w.ad_client_id
-LEFT JOIN m_product p ON p.m_product_id = pp.m_product_id
-LEFT JOIN m_product_warehouse_qtys_v pwq ON pwq.m_product_id = pp.m_product_id AND pwq.m_warehouse_id = w.m_warehouse_id]]></view>
+    <view name="M_PRODUCT_PRICE_WAREHOUSE_V"><![CDATA[SELECT COALESCE(w.m_warehouse_id, '-') || pp.m_productprice_id AS m_product_price_warehouse_v_id, p.ad_client_id, p.ad_org_id, p.isactive, p.updated, p.updatedby, p.created, p.createdby, p.m_product_id, w.m_warehouse_id, pp.m_productprice_id,  CASE WHEN p.producttype <> 'I' OR p.isstocked = 'N' THEN 99999 ELSE COALESCE(pwq.qtyonhand - pwq.qtyreserved, 0) END AS qty_available,  CASE WHEN p.producttype <> 'I' OR p.isstocked = 'N' THEN 99999 ELSE COALESCE(pwq.qtyonhand, 0) END AS qty_onhand,  CASE WHEN p.producttype <> 'I' OR p.isstocked = 'N' THEN 0 ELSE COALESCE(pwq.qtyreserved, 0) END AS qty_reserved,  CASE WHEN p.producttype <> 'I' OR p.isstocked = 'N' THEN 0 ELSE COALESCE(pwq.qtyordered, 0) END AS qty_ordered, pp.pricelist, pp.pricestd, pp.pricelimit FROM m_productprice pp LEFT JOIN m_warehouse w ON pp.ad_client_id = w.ad_client_id LEFT JOIN m_product p ON p.m_product_id = pp.m_product_id LEFT JOIN m_product_warehouse_qtys_v pwq ON pwq.m_product_id = pp.m_product_id AND pwq.m_warehouse_id = w.m_warehouse_id]]></view>
   </database>
--- a/src-db/database/model/views/M_PRODUCT_STOCK_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/M_PRODUCT_STOCK_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,15 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW M_PRODUCT_STOCK_V">
-    <view name="M_PRODUCT_STOCK_V"><![CDATA[SELECT p.m_product_id || sd.m_storage_detail_id AS m_product_stock_v_id, l.ad_client_id, l.ad_org_id, l.isactive, sd.created, sd.createdby, sd.updated, sd.updatedby, sd.m_product_id, sd.qtyonhand, sd.qtyorderonhand, sd.preqtyonhand, sd.preqtyorderonhand, sd.c_uom_id, sd.m_product_uom_id, sd.m_attributesetinstance_id, sd.m_locator_id, 'Y' AS stocked
-FROM m_storage_detail sd
-JOIN m_locator l ON sd.m_locator_id = l.m_locator_id
-JOIN m_product p ON sd.m_product_id = p.m_product_id AND p.isactive = 'Y'
-WHERE sd.qtyonhand <> 0 OR COALESCE(sd.qtyorderonhand, 0) <> 0
-UNION ALL 
-SELECT p.m_product_id AS m_product_stock_v_id, p.ad_client_id, p.ad_org_id, p.isactive, p.created, p.createdby, p.updated, p.updatedby, p.m_product_id, 0 AS qtyonhand, NULL AS qtyorderonhand, 0 AS preqtyonhand, NULL AS preqtyorderonhand, p.c_uom_id, NULL AS m_product_uom_id, 
-CASE p.attrsetvaluetype
-WHEN 'D' THEN p.m_attributesetinstance_id
-ELSE NULL
-END AS m_attributesetinstance_id, NULL AS m_locator_id, 'N' AS stocked
-FROM m_product p]]></view>
+    <view name="M_PRODUCT_STOCK_V"><![CDATA[SELECT p.m_product_id || sd.m_storage_detail_id AS m_product_stock_v_id, l.ad_client_id, l.ad_org_id, l.isactive, sd.created, sd.createdby, sd.updated, sd.updatedby, sd.m_product_id, sd.qtyonhand, sd.qtyorderonhand, sd.preqtyonhand, sd.preqtyorderonhand, sd.c_uom_id, sd.m_product_uom_id, sd.m_attributesetinstance_id, sd.m_locator_id, 'Y' AS stocked FROM m_storage_detail sd JOIN m_locator l ON sd.m_locator_id = l.m_locator_id JOIN m_product p ON sd.m_product_id = p.m_product_id AND p.isactive = 'Y' WHERE sd.qtyonhand <> 0 OR COALESCE(sd.qtyorderonhand, 0) <> 0 UNION ALL  SELECT p.m_product_id AS m_product_stock_v_id, p.ad_client_id, p.ad_org_id, p.isactive, p.created, p.createdby, p.updated, p.updatedby, p.m_product_id, 0 AS qtyonhand, NULL AS qtyorderonhand, 0 AS preqtyonhand, NULL AS preqtyorderonhand, p.c_uom_id, NULL AS m_product_uom_id,  CASE p.attrsetvaluetype WHEN 'D' THEN p.m_attributesetinstance_id ELSE NULL END AS m_attributesetinstance_id, NULL AS m_locator_id, 'N' AS stocked FROM m_product p]]></view>
   </database>
--- a/src-db/database/model/views/M_PRODUCT_WAREHOUSE_QTYS_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/M_PRODUCT_WAREHOUSE_QTYS_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,11 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW M_PRODUCT_WAREHOUSE_QTYS_V">
-    <view name="M_PRODUCT_WAREHOUSE_QTYS_V"><![CDATA[SELECT sd.m_product_id, sd.m_warehouse_id, sd.qtyonhand, COALESCE(s.qtyordered, 0) AS qtyordered, COALESCE(s.qtyreserved, 0) AS qtyreserved
-FROM (SELECT sdd.m_product_id, l.m_warehouse_id, sum(sdd.qtyonhand) AS qtyonhand
-FROM m_storage_detail sdd
-JOIN m_locator l ON sdd.m_locator_id = l.m_locator_id
-GROUP BY sdd.m_product_id, l.m_warehouse_id) sd
-LEFT JOIN (SELECT sp.m_product_id, sp.m_warehouse_id, sum(sp.qtyordered) AS qtyordered, sum(sp.qtyreserved) AS qtyreserved
-FROM m_storage_pending sp
-GROUP BY sp.m_product_id, sp.m_warehouse_id) s ON sd.m_product_id = s.m_product_id AND sd.m_warehouse_id = s.m_warehouse_id]]></view>
+    <view name="M_PRODUCT_WAREHOUSE_QTYS_V"><![CDATA[SELECT sd.m_product_id, sd.m_warehouse_id, sd.qtyonhand, COALESCE(s.qtyordered, 0) AS qtyordered, COALESCE(s.qtyreserved, 0) AS qtyreserved FROM (SELECT sdd.m_product_id, l.m_warehouse_id, sum(sdd.qtyonhand) AS qtyonhand FROM m_storage_detail sdd JOIN m_locator l ON sdd.m_locator_id = l.m_locator_id GROUP BY sdd.m_product_id, l.m_warehouse_id) sd LEFT JOIN (SELECT sp.m_product_id, sp.m_warehouse_id, sum(sp.qtyordered) AS qtyordered, sum(sp.qtyreserved) AS qtyreserved FROM m_storage_pending sp GROUP BY sp.m_product_id, sp.m_warehouse_id) s ON sd.m_product_id = s.m_product_id AND sd.m_warehouse_id = s.m_warehouse_id]]></view>
   </database>
--- a/src-db/database/model/views/M_RM_RECEIPT_PICK_EDIT.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/M_RM_RECEIPT_PICK_EDIT.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,16 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW M_RM_RECEIPT_PICK_EDIT">
-    <view name="M_RM_RECEIPT_PICK_EDIT"><![CDATA[SELECT ol.c_orderline_id AS m_rm_receipt_pick_edit_id, ol.ad_client_id, COALESCE(iol.ad_org_id, ol.ad_org_id) AS ad_org_id, ol.isactive, ol.created, ol.createdby, COALESCE(iol.updated, ol.updated) AS updated, ol.updatedby, iol.m_inout_id, 
-CASE
-WHEN iol.m_inoutline_id IS NOT NULL THEN 'Y'
-ELSE 'N'
-END AS ob_selected, ol.c_orderline_id, ol.m_product_id, ol.c_uom_id, ol.m_attributesetinstance_id, (-1) * ol.qtyordered AS returned, (-1) * (ol.qtyordered - ol.qtydelivered) AS pendingqty, (-1) * iol.movementqty AS receivingqty, iol.m_condition_goods_id, iol.m_locator_id, o.documentno AS returnorderno, o.issotrx, ol.line, iol.m_inoutline_id
-FROM c_orderline ol
-JOIN c_order o ON o.c_order_id = ol.c_order_id
-JOIN m_product p ON ol.m_product_id = p.m_product_id
-JOIN c_doctype dt ON dt.c_doctype_id = o.c_doctypetarget_id AND dt.isreturn = 'Y'
-LEFT JOIN (SELECT il2.m_inoutline_id, il2.ad_client_id, il2.ad_org_id, il2.isactive, il2.created, il2.createdby, il2.updated, il2.updatedby, il2.line, il2.description, il2.m_inout_id, il2.c_orderline_id, il2.m_locator_id, il2.m_product_id, il2.c_uom_id, il2.movementqty, il2.isinvoiced, il2.m_attributesetinstance_id, il2.isdescription, il2.quantityorder, il2.m_product_uom_id, il2.m_condition_goods_id
-FROM m_inoutline il2
-JOIN m_inout i2 ON il2.m_inout_id = i2.m_inout_id AND i2.processed = 'N') iol ON iol.c_orderline_id = ol.c_orderline_id
-WHERE (ol.qtyordered - ol.qtydelivered) <> 0 AND o.docstatus = 'CO']]></view>
+    <view name="M_RM_RECEIPT_PICK_EDIT"><![CDATA[SELECT ol.c_orderline_id AS m_rm_receipt_pick_edit_id, ol.ad_client_id, COALESCE(iol.ad_org_id, ol.ad_org_id) AS ad_org_id, ol.isactive, ol.created, ol.createdby, COALESCE(iol.updated, ol.updated) AS updated, ol.updatedby, iol.m_inout_id,  CASE WHEN iol.m_inoutline_id IS NOT NULL THEN 'Y' ELSE 'N' END AS ob_selected, ol.c_orderline_id, ol.m_product_id, ol.c_uom_id, ol.m_attributesetinstance_id, (-1) * ol.qtyordered AS returned, (-1) * (ol.qtyordered - ol.qtydelivered) AS pendingqty, (-1) * iol.movementqty AS receivingqty, iol.m_condition_goods_id, iol.m_locator_id, o.documentno AS returnorderno, o.issotrx, ol.line, iol.m_inoutline_id FROM c_orderline ol JOIN c_order o ON o.c_order_id = ol.c_order_id JOIN m_product p ON ol.m_product_id = p.m_product_id JOIN c_doctype dt ON dt.c_doctype_id = o.c_doctypetarget_id AND dt.isreturn = 'Y' LEFT JOIN (SELECT il2.m_inoutline_id, il2.ad_client_id, il2.ad_org_id, il2.isactive, il2.created, il2.createdby, il2.updated, il2.updatedby, il2.line, il2.description, il2.m_inout_id, il2.c_orderline_id, il2.m_locator_id, il2.m_product_id, il2.c_uom_id, il2.movementqty, il2.isinvoiced, il2.m_attributesetinstance_id, il2.isdescription, il2.quantityorder, il2.m_product_uom_id, il2.m_condition_goods_id FROM m_inoutline il2 JOIN m_inout i2 ON il2.m_inout_id = i2.m_inout_id AND i2.processed = 'N') iol ON iol.c_orderline_id = ol.c_orderline_id WHERE (ol.qtyordered - ol.qtydelivered) <> 0 AND o.docstatus = 'CO']]></view>
   </database>
--- a/src-db/database/model/views/M_RM_SHIPMENT_PICK_EDIT.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/M_RM_SHIPMENT_PICK_EDIT.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,20 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW M_RM_SHIPMENT_PICK_EDIT">
-    <view name="M_RM_SHIPMENT_PICK_EDIT"><![CDATA[SELECT sd.m_storage_detail_id || ol.c_orderline_id AS m_rm_shipment_pick_edit_id, ol.ad_client_id, COALESCE(iol.ad_org_id, ol.ad_org_id) AS ad_org_id, ol.isactive, ol.createdby, ol.created, ol.updatedby, ol.updated, o.documentno AS returnorderno, ol.m_product_id, ol.m_attributesetinstance_id, ol.c_uom_id, (-1) * ol.qtyordered AS returned, (-1) * iol.movementqty AS movementqty, sd.m_locator_id, COALESCE(sd.qtyonhand, 0) AS availableqty, (-1) * (ol.qtyordered - COALESCE((SELECT sum(iol3.movementqty) AS sum
-FROM m_inoutline iol3
-JOIN m_inout io3 ON iol3.m_inout_id = io3.m_inout_id AND io3.processed = 'Y'
-WHERE iol3.c_orderline_id = ol.c_orderline_id), 0)) AS pendingqty, iol.m_inout_id, 
-CASE
-WHEN iol.m_inout_id IS NOT NULL THEN 'Y'
-ELSE 'N'
-END AS ob_selected, ol.c_orderline_id, ol.line, iol.m_inoutline_id
-FROM c_orderline ol
-JOIN c_order o ON o.c_order_id = ol.c_order_id AND o.processed = 'Y' AND o.issotrx = 'N'
-LEFT JOIN m_storage_detail sd ON sd.m_product_id = ol.m_product_id AND COALESCE(sd.m_attributesetinstance_id, '0') = COALESCE(ol.m_attributesetinstance_id, '0') AND sd.qtyonhand > 0
-LEFT JOIN m_locator l ON sd.m_locator_id = l.m_locator_id
-JOIN c_doctype dt ON o.c_doctypetarget_id = dt.c_doctype_id AND dt.isreturn = 'Y'
-LEFT JOIN (SELECT iol2.m_inoutline_id, iol2.m_inout_id, iol2.movementqty, iol2.c_orderline_id, iol2.ad_org_id, iol2.m_locator_id
-FROM m_inoutline iol2
-JOIN m_inout io2 ON iol2.m_inout_id = io2.m_inout_id AND io2.processed = 'N') iol ON iol.c_orderline_id = ol.c_orderline_id AND iol.m_locator_id = sd.m_locator_id
-WHERE o.docstatus = 'CO']]></view>
+    <view name="M_RM_SHIPMENT_PICK_EDIT"><![CDATA[SELECT sd.m_storage_detail_id || ol.c_orderline_id AS m_rm_shipment_pick_edit_id, ol.ad_client_id, COALESCE(iol.ad_org_id, ol.ad_org_id) AS ad_org_id, ol.isactive, ol.createdby, ol.created, ol.updatedby, ol.updated, o.documentno AS returnorderno, ol.m_product_id, ol.m_attributesetinstance_id, ol.c_uom_id, (-1) * ol.qtyordered AS returned, (-1) * iol.movementqty AS movementqty, sd.m_locator_id, COALESCE(sd.qtyonhand, 0) AS availableqty, (-1) * (ol.qtyordered - COALESCE((SELECT sum(iol3.movementqty) AS sum FROM m_inoutline iol3 JOIN m_inout io3 ON iol3.m_inout_id = io3.m_inout_id AND io3.processed = 'Y' WHERE iol3.c_orderline_id = ol.c_orderline_id), 0)) AS pendingqty, iol.m_inout_id,  CASE WHEN iol.m_inout_id IS NOT NULL THEN 'Y' ELSE 'N' END AS ob_selected, ol.c_orderline_id, ol.line, iol.m_inoutline_id FROM c_orderline ol JOIN c_order o ON o.c_order_id = ol.c_order_id AND o.processed = 'Y' AND o.issotrx = 'N' LEFT JOIN m_storage_detail sd ON sd.m_product_id = ol.m_product_id AND COALESCE(sd.m_attributesetinstance_id, '0') = COALESCE(ol.m_attributesetinstance_id, '0') AND sd.qtyonhand > 0 LEFT JOIN m_locator l ON sd.m_locator_id = l.m_locator_id JOIN c_doctype dt ON o.c_doctypetarget_id = dt.c_doctype_id AND dt.isreturn = 'Y' LEFT JOIN (SELECT iol2.m_inoutline_id, iol2.m_inout_id, iol2.movementqty, iol2.c_orderline_id, iol2.ad_org_id, iol2.m_locator_id FROM m_inoutline iol2 JOIN m_inout io2 ON iol2.m_inout_id = io2.m_inout_id AND io2.processed = 'N') iol ON iol.c_orderline_id = ol.c_orderline_id AND iol.m_locator_id = sd.m_locator_id WHERE o.docstatus = 'CO']]></view>
   </database>
--- a/src-db/database/model/views/M_TRANSACTION_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/M_TRANSACTION_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,6 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW M_TRANSACTION_V">
-    <view name="M_TRANSACTION_V"><![CDATA[SELECT t.m_transaction_id AS m_transaction_v_id, t.ad_client_id, t.ad_org_id, t.isactive, t.created, t.createdby, t.updated, t.updatedby, t.movementdate, t.movementqty, t.m_product_id, t.m_locator_id, p.m_product_category_id, p.value, po.c_bpartner_id, po.pricepo, po.pricelastpo, po.pricelist
-FROM m_transaction t, m_product p, m_product_po po
-WHERE t.m_product_id = p.m_product_id AND t.m_product_id = po.m_product_id AND po.iscurrentvendor = 'Y']]></view>
+    <view name="M_TRANSACTION_V"><![CDATA[SELECT t.m_transaction_id AS m_transaction_v_id, t.ad_client_id, t.ad_org_id, t.isactive, t.created, t.createdby, t.updated, t.updatedby, t.movementdate, t.movementqty, t.m_product_id, t.m_locator_id, p.m_product_category_id, p.value, po.c_bpartner_id, po.pricepo, po.pricelastpo, po.pricelist FROM m_transaction t, m_product p, m_product_po po WHERE t.m_product_id = p.m_product_id AND t.m_product_id = po.m_product_id AND po.iscurrentvendor = 'Y']]></view>
   </database>
--- a/src-db/database/model/views/S_TIMEEXPENSELINE_V.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/model/views/S_TIMEEXPENSELINE_V.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1,7 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW S_TIMEEXPENSELINE_V">
-    <view name="S_TIMEEXPENSELINE_V"><![CDATA[SELECT tel.s_timeexpenseline_id, tel.ad_client_id, tel.ad_org_id, tel.isactive, tel.created, tel.createdby, tel.updated, tel.updatedby, tel.s_timeexpense_id, tel.line, tel.istimereport, te.datereport, tel.m_product_id, tel.qty, tel.expenseamt, tel.c_currency_id, tel.convertedamt, tel.s_resourceassignment_id, tel.description, tel.note, tel.isinvoiced, tel.c_project_id, tel.c_activity_id, tel.c_campaign_id, tel.c_invoiceline_id, tel.invoiceprice, tel.c_uom_id, tel.c_orderline_id, tel.c_projectphase_id, tel.c_projecttask_id, tel.s_timetype_id, te.c_bpartner_id, tel.dateexpense, tel.c_bpartner_id AS tel_c_bpartner_id
-FROM s_timeexpenseline tel
-JOIN s_timeexpense te ON tel.s_timeexpense_id = te.s_timeexpense_id
-WHERE tel.qty <> 0 AND tel.c_invoiceline_id IS NULL AND te.processed = 'Y' AND tel.isactive = 'Y' AND te.isactive = 'Y' AND tel.istimereport <> 'Y']]></view>
+    <view name="S_TIMEEXPENSELINE_V"><![CDATA[SELECT tel.s_timeexpenseline_id, tel.ad_client_id, tel.ad_org_id, tel.isactive, tel.created, tel.createdby, tel.updated, tel.updatedby, tel.s_timeexpense_id, tel.line, tel.istimereport, te.datereport, tel.m_product_id, tel.qty, tel.expenseamt, tel.c_currency_id, tel.convertedamt, tel.s_resourceassignment_id, tel.description, tel.note, tel.isinvoiced, tel.c_project_id, tel.c_activity_id, tel.c_campaign_id, tel.c_invoiceline_id, tel.invoiceprice, tel.c_uom_id, tel.c_orderline_id, tel.c_projectphase_id, tel.c_projecttask_id, tel.s_timetype_id, te.c_bpartner_id, tel.dateexpense, tel.c_bpartner_id AS tel_c_bpartner_id FROM s_timeexpenseline tel JOIN s_timeexpense te ON tel.s_timeexpense_id = te.s_timeexpense_id WHERE tel.qty <> 0 AND tel.c_invoiceline_id IS NULL AND te.processed = 'Y' AND tel.isactive = 'Y' AND te.isactive = 'Y' AND tel.istimereport <> 'Y']]></view>
   </database>
--- a/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -1330,6 +1330,17 @@
 <!--5690CE03FBE749F3BEF24C562F8AB3AA-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--5690CE03FBE749F3BEF24C562F8AB3AA--></AD_AUXILIARINPUT>
 
+<!--571778C5E2AD4A13BDD7DD15A4DA470E--><AD_AUXILIARINPUT>
+<!--571778C5E2AD4A13BDD7DD15A4DA470E-->  <AD_AUXILIARINPUT_ID><![CDATA[571778C5E2AD4A13BDD7DD15A4DA470E]]></AD_AUXILIARINPUT_ID>
+<!--571778C5E2AD4A13BDD7DD15A4DA470E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--571778C5E2AD4A13BDD7DD15A4DA470E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--571778C5E2AD4A13BDD7DD15A4DA470E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--571778C5E2AD4A13BDD7DD15A4DA470E-->  <AD_TAB_ID><![CDATA[270]]></AD_TAB_ID>
+<!--571778C5E2AD4A13BDD7DD15A4DA470E-->  <NAME><![CDATA[Posted]]></NAME>
+<!--571778C5E2AD4A13BDD7DD15A4DA470E-->  <CODE><![CDATA[@SQL=SELECT POSTED FROM C_INVOICE WHERE C_INVOICE_ID = @C_INVOICE_ID@]]></CODE>
+<!--571778C5E2AD4A13BDD7DD15A4DA470E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--571778C5E2AD4A13BDD7DD15A4DA470E--></AD_AUXILIARINPUT>
+
 <!--59A80385C31048AEBFED1D3B8E90DB62--><AD_AUXILIARINPUT>
 <!--59A80385C31048AEBFED1D3B8E90DB62-->  <AD_AUXILIARINPUT_ID><![CDATA[59A80385C31048AEBFED1D3B8E90DB62]]></AD_AUXILIARINPUT_ID>
 <!--59A80385C31048AEBFED1D3B8E90DB62-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Mon Oct 29 09:38:37 2012 +0100
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Mon Oct 29 09:55:52 2012 +0100
@@ -221719,6 +221719,42 @@
 <!--11D5E322E2EC45E884C876155BCE29AA-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--11D5E322E2EC45E884C876155BCE29AA--></AD_COLUMN>
 
+<!--11F755DE7007411FA9D61421815A71E1--><AD_COLUMN>
+<!--11F755DE7007411FA9D61421815A71E1-->  <AD_COLUMN_ID><![CDATA[11F755DE7007411FA9D61421815A71E1]]></AD_COLUMN_ID>
+<!--11F755DE7007411FA9D61421815A71E1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--11F755DE7007411FA9D61421815A71E1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--11F755DE7007411FA9D61421815A71E1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--11F755DE7007411FA9D61421815A71E1-->  <NAME><![CDATA[Creation Date]]></NAME>
+<!--11F755DE7007411FA9D61421815A71E1-->  <DESCRIPTION><![CDATA[The date that this record is completed.]]></DESCRIPTION>
+<!--11F755DE7007411FA9D61421815A71E1-->  <HELP><![CDATA[The Created field indicates the date that this record was created.]]></HELP>
+<!--11F755DE7007411FA9D61421815A71E1-->  <COLUMNNAME><![CDATA[Created]]></COLUMNNAME>
+<!--11F755DE7007411FA9D61421815A71E1-->  <AD_TABLE_ID><![CDATA[66AED72572944ACB9BED8B132EC89A07]]></AD_TABLE_ID>
+<!--11F755DE7007411FA9D61421815A71E1-->  <AD_REFERENCE_ID><![CDATA[16]]></AD_REFERENCE_ID>
+<!--11F755DE7007411FA9D61421815A71E1-->  <FIELDLENGTH><![CDATA[19]]></FIELDLENGTH>
+<!--11F755DE7007411FA9D61421815A71E1-->  <DEFAULTVALUE><![CDATA[@#Date@]]></DEFAULTVALUE>
+<!--11F755DE7007411FA9D61421815A71E1-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--11F755DE7007411FA9D61421815A71E1-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--11F755DE7007411FA9D61421815A71E1-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--11F755DE7007411FA9D61421815A71E1-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--11F755DE7007411FA9D61421815A71E1-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--11F755DE7007411FA9D61421815A71E1-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--11F755DE7007411FA9D61421815A71E1-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--11F755DE7007411FA9D61421815A71E1-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--11F755DE7007411FA9D61421815A71E1-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--11F755DE7007411FA9D61421815A71E1-->  <AD_ELEMENT_ID><![CDATA[245]]></AD_ELEMENT_ID>
+<!--11F755DE7007411FA9D61421815A71E1-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--11F755DE7007411FA9D61421815A71E1-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--11F755DE7007411FA9D61421815A71E1-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--11F755DE7007411FA9D61421815A71E1-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--11F755DE7007411FA9D61421815A71E1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--11F755DE7007411FA9D61421815A71E1-->  <POSITION><![CDATA[5]]></POSITION>
+<!--11F755DE7007411FA9D61421815A71E1-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--11F755DE7007411FA9D61421815A71E1-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--11F755DE7007411FA9D61421815A71E1-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--11F755DE7007411FA9D61421815A71E1-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--11F755DE7007411FA9D61421815A71E1-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--11F755DE7007411FA9D61421815A71E1--></AD_COLUMN>
+
 <!--12D57FF1727C4142B92FE30883E69C3A--><AD_COLUMN>
 <!--12D57FF1727C4142B92FE30883E69C3A-->  <AD_COLUMN_ID><![CDATA[12D57FF1727C4142B92FE30883E69C3A]]></AD_COLUMN_ID>
 <!--12D57FF1727C4142B92FE30883E69C3A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -222681,6 +222717,42 @@
 <!--18CC6322D9B14046A9174BAF3542F70D-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--18CC6322D9B14046A9174BAF3542F70D--></AD_COLUMN>
 
+<!--1943ED248C1C435EB5E4B95BE7779895--><AD_COLUMN>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <AD_COLUMN_ID><![CDATA[1943ED248C1C435EB5E4B95BE7779895]]></AD_COLUMN_ID>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <NAME><![CDATA[Revenue Plan Type]]></NAME>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <DESCRIPTION><![CDATA[Type of plan used to defer revenues]]></DESCRIPTION>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <HELP><![CDATA[Set the type of plan to be used when deferring revenue]]></HELP>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <COLUMNNAME><![CDATA[Revplantype]]></COLUMNNAME>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <AD_TABLE_ID><![CDATA[208]]></AD_TABLE_ID>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <AD_REFERENCE_VALUE_ID><![CDATA[73625A8F22EF4CD7808603156BA606D7]]></AD_REFERENCE_VALUE_ID>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <SEQNO><![CDATA[340]]></SEQNO>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <AD_ELEMENT_ID><![CDATA[16210EDFAEA24E95B02C020BFAED0D88]]></AD_ELEMENT_ID>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <POSITION><![CDATA[73]]></POSITION>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--1943ED248C1C435EB5E4B95BE7779895-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--1943ED248C1C435EB5E4B95BE7779895--></AD_COLUMN>
+
 <!--196BCA9A6C8A4515874C148207641D7D--><AD_COLUMN>
 <!--196BCA9A6C8A4515874C148207641D7D-->  <AD_COLUMN_ID><![CDATA[196BCA9A6C8A4515874C148207641D7D]]></AD_COLUMN_ID>
 <!--196BCA9A6C8A4515874C148207641D7D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -223035,6 +223107,44 @@
 <!--1D24F30B670940F38D1AD3377C36B534-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--1D24F30B670940F38D1AD3377C36B534--></AD_COLUMN>
 
+<!--1DAE90C2D10B465D895F57B0E82C5E02--><AD_COLUMN>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <AD_COLUMN_ID><![CDATA[1DAE90C2D10B465D895F57B0E82C5E02]]></AD_COLUMN_ID>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <NAME><![CDATA[Period]]></NAME>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <DESCRIPTION><![CDATA[A specified time period.]]></DESCRIPTION>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <HELP><![CDATA[The Period indicates an exclusive range of dates for a calendar.]]></HELP>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <COLUMNNAME><![CDATA[C_Period_ID]]></COLUMNNAME>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <AD_TABLE_ID><![CDATA[333]]></AD_TABLE_ID>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <AD_REFERENCE_ID><![CDATA[18]]></AD_REFERENCE_ID>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <AD_REFERENCE_VALUE_ID><![CDATA[233]]></AD_REFERENCE_VALUE_ID>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <AD_VAL_RULE_ID><![CDATA[E0541EB2493547BC934F5EFA044AB668]]></AD_VAL_RULE_ID>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <READONLYLOGIC><![CDATA[@Posted@='Y']]></READONLYLOGIC>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <SEQNO><![CDATA[153]]></SEQNO>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <AD_ELEMENT_ID><![CDATA[206]]></AD_ELEMENT_ID>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <POSITION><![CDATA[46]]></POSITION>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--1DAE90C2D10B465D895F57B0E82C5E02--></AD_COLUMN>
+
 <!--1DD4E1DE19554DF3920C7F5301943B60--><AD_COLUMN>
 <!--1DD4E1DE19554DF3920C7F5301943B60-->  <AD_COLUMN_ID><![CDATA[1DD4E1DE19554DF3920C7F5301943B60]]></AD_COLUMN_ID>
 <!--1DD4E1DE19554DF3920C7F5301943B60-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -224741,6 +224851,42 @@
 <!--28FCAF6507574F109D7EBA2027E165DF-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--28FCAF6507574F109D7EBA2027E165DF--></AD_COLUMN>
 
+<!--2914BFE09D40432BB4A883E963C3E7D5--><AD_COLUMN>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <AD_COLUMN_ID><![CDATA[2914BFE09D40432BB4A883E963C3E7D5]]></AD_COLUMN_ID>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <NAME><![CDATA[P_Def_Expense_Acct]]></NAME>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <DESCRIPTION><![CDATA[Used when expense is deferred from a purchased product.]]></DESCRIPTION>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <HELP><![CDATA[Used when expense is deferred from a purchased product.]]></HELP>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <COLUMNNAME><![CDATA[P_Def_Expense_Acct]]></COLUMNNAME>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <AD_TABLE_ID><![CDATA[401]]></AD_TABLE_ID>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <AD_REFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></AD_REFERENCE_ID>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <AD_REFERENCE_VALUE_ID><![CDATA[4FA73FBEF8CE4A54926DDD317E385486]]></AD_REFERENCE_VALUE_ID>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <SEQNO><![CDATA[21]]></SEQNO>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <AD_ELEMENT_ID><![CDATA[2D2C180E4B004B76AA0CE7C2ABA651A3]]></AD_ELEMENT_ID>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <POSITION><![CDATA[23]]></POSITION>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--2914BFE09D40432BB4A883E963C3E7D5-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--2914BFE09D40432BB4A883E963C3E7D5--></AD_COLUMN>
+
 <!--292259893A304705B95F93A03ABEBE05--><AD_COLUMN>
 <!--292259893A304705B95F93A03ABEBE05-->  <AD_COLUMN_ID><![CDATA[292259893A304705B95F93A03ABEBE05]]></AD_COLUMN_ID>
 <!--292259893A304705B95F93A03ABEBE05-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -224917,6 +225063,43 @@
 <!--2AA57E9B932549BCB74C9DD283840AD2-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--2AA57E9B932549BCB74C9DD283840AD2--></AD_COLUMN>
 
+<!--2B1857B270ED4D5A9AC956BB6AA78F24--><AD_COLUMN>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <AD_COLUMN_ID><![CDATA[2B1857B270ED4D5A9AC956BB6AA78F24]]></AD_COLUMN_ID>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <NAME><![CDATA[Revenue Plan Type]]></NAME>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <DESCRIPTION><![CDATA[Type of plan used to defer revenues]]></DESCRIPTION>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <HELP><![CDATA[Set the type of plan to be used when deferring revenue]]></HELP>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <COLUMNNAME><![CDATA[Revplantype]]></COLUMNNAME>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <AD_TABLE_ID><![CDATA[333]]></AD_TABLE_ID>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <AD_REFERENCE_VALUE_ID><![CDATA[73625A8F22EF4CD7808603156BA606D7]]></AD_REFERENCE_VALUE_ID>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <READONLYLOGIC><![CDATA[@Posted@='Y']]></READONLYLOGIC>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <SEQNO><![CDATA[123]]></SEQNO>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <AD_ELEMENT_ID><![CDATA[16210EDFAEA24E95B02C020BFAED0D88]]></AD_ELEMENT_ID>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <POSITION><![CDATA[43]]></POSITION>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24--></AD_COLUMN>
+
 <!--2B5F702BA50F4C2ABB8E14B77F8BE893--><AD_COLUMN>
 <!--2B5F702BA50F4C2ABB8E14B77F8BE893-->  <AD_COLUMN_ID><![CDATA[2B5F702BA50F4C2ABB8E14B77F8BE893]]></AD_COLUMN_ID>
 <!--2B5F702BA50F4C2ABB8E14B77F8BE893-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -225165,6 +225348,42 @@
 <!--2CA46C14D66F4B7AA6550531F6D329E7-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--2CA46C14D66F4B7AA6550531F6D329E7--></AD_COLUMN>
 
+<!--2D1E642AFB6B4AD495F3CA5105915E15--><AD_COLUMN>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <AD_COLUMN_ID><![CDATA[2D1E642AFB6B4AD495F3CA5105915E15]]></AD_COLUMN_ID>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <NAME><![CDATA[Product Deferred Revenue]]></NAME>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <DESCRIPTION><![CDATA[Used to defer revenue for a sold product]]></DESCRIPTION>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <HELP><![CDATA[Used when revenue is deferred fro a sold product.]]></HELP>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <COLUMNNAME><![CDATA[P_Def_Revenue_Acct]]></COLUMNNAME>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <AD_TABLE_ID><![CDATA[273]]></AD_TABLE_ID>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <AD_REFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></AD_REFERENCE_ID>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <AD_REFERENCE_VALUE_ID><![CDATA[4FA73FBEF8CE4A54926DDD317E385486]]></AD_REFERENCE_VALUE_ID>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <SEQNO><![CDATA[12]]></SEQNO>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <AD_ELEMENT_ID><![CDATA[5AFB22E6D5924B6DBE8F5C4FE839A5AE]]></AD_ELEMENT_ID>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <POSITION><![CDATA[21]]></POSITION>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--2D1E642AFB6B4AD495F3CA5105915E15-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--2D1E642AFB6B4AD495F3CA5105915E15--></AD_COLUMN>
+
 <!--2D3345CE7B1D46208C9B5C380C7A159A--><AD_COLUMN>
 <!--2D3345CE7B1D46208C9B5C380C7A159A-->  <AD_COLUMN_ID><![CDATA[2D3345CE7B1D46208C9B5C380C7A159A]]></AD_COLUMN_ID>
 <!--2D3345CE7B1D46208C9B5C380C7A159A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -225343,6 +225562,42 @@
 <!--2FD790AF217148AE8D7628ECC9F3D7C3-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--2FD790AF217148AE8D7628ECC9F3D7C3--></AD_COLUMN>
 
+<!--3016237232444E83962F47A938F811CD--><AD_COLUMN>
+<!--3016237232444E83962F47A938F811CD-->  <AD_COLUMN_ID><![CDATA[3016237232444E83962F47A938F811CD]]></AD_COLUMN_ID>
+<!--3016237232444E83962F47A938F811CD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3016237232444E83962F47A938F811CD-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3016237232444E83962F47A938F811CD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3016237232444E83962F47A938F811CD-->  <NAME><![CDATA[Organization]]></NAME>
+<!--3016237232444E83962F47A938F811CD-->  <DESCRIPTION><![CDATA[Organizational entity within client]]></DESCRIPTION>
+<!--3016237232444E83962F47A938F811CD-->  <HELP><![CDATA[An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.]]></HELP>
+<!--3016237232444E83962F47A938F811CD-->  <COLUMNNAME><![CDATA[AD_Org_ID]]></COLUMNNAME>
+<!--3016237232444E83962F47A938F811CD-->  <AD_TABLE_ID><![CDATA[66AED72572944ACB9BED8B132EC89A07]]></AD_TABLE_ID>
+<!--3016237232444E83962F47A938F811CD-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--3016237232444E83962F47A938F811CD-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--3016237232444E83962F47A938F811CD-->  <DEFAULTVALUE><![CDATA[@AD_ORG_ID@]]></DEFAULTVALUE>
+<!--3016237232444E83962F47A938F811CD-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--3016237232444E83962F47A938F811CD-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--3016237232444E83962F47A938F811CD-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--3016237232444E83962F47A938F811CD-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--3016237232444E83962F47A938F811CD-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!