Restored old views so that no differences are found when exported
authorAntonio Moreno <antonio.moreno@openbravo.com>
Fri, 25 Apr 2008 13:58:34 +0000
changeset 777 6e89ba1fd7d9
parent 776 d1226b967a28
child 778 6150609a1a0a
Restored old views so that no differences are found when exported
src-db/database/model/views/AD_FIELD_V.xml
src-db/database/model/views/AD_FIELD_VT.xml
src-db/database/model/views/AD_INTEGER.xml
src-db/database/model/views/AD_REF_LIST_V.xml
src-db/database/model/views/AD_TABLE_POST_V.xml
src-db/database/model/views/AD_TAB_V.xml
src-db/database/model/views/AD_TAB_VT.xml
src-db/database/model/views/AD_USER_ROLES_V.xml
src-db/database/model/views/AD_WINDOW_VT.xml
src-db/database/model/views/A_ASSET_AMORTIZATION.xml
src-db/database/model/views/C_DEBT_PAYMENT_CANCEL.xml
src-db/database/model/views/C_DEBT_PAYMENT_GENERATE.xml
src-db/database/model/views/C_DEBT_PAYMENT_V.xml
src-db/database/model/views/C_INVOICELINE_V.xml
src-db/database/model/views/C_INVOICE_CANDIDATE_V.xml
src-db/database/model/views/C_INVOICE_HEADER_V.xml
src-db/database/model/views/C_INVOICE_HEADER_VT.xml
src-db/database/model/views/C_INVOICE_LINETAX_V.xml
src-db/database/model/views/C_INVOICE_LINETAX_VT.xml
src-db/database/model/views/C_INVOICE_V.xml
src-db/database/model/views/C_ORDER_HEADER_V.xml
src-db/database/model/views/C_ORDER_HEADER_VT.xml
src-db/database/model/views/C_ORDER_LINETAX_V.xml
src-db/database/model/views/C_ORDER_LINETAX_VT.xml
src-db/database/model/views/C_PROJECT_DETAILS_V.xml
src-db/database/model/views/C_PROJECT_DETAILS_VT.xml
src-db/database/model/views/C_PROJECT_HEADER_V.xml
src-db/database/model/views/C_PROJECT_HEADER_VT.xml
src-db/database/model/views/GL_JOURNALLINE_ACCT_V.xml
src-db/database/model/views/MA_PROCESSPLAN_TOTALIZED.xml
src-db/database/model/views/MA_SEQUENCE_EMPLOYEE_COST.xml
src-db/database/model/views/MA_SEQUENCE_INDIRECT_COST_COST.xml
src-db/database/model/views/MA_SEQUENCE_MACHINE_COST.xml
src-db/database/model/views/M_INOUT_CANDIDATE_V.xml
src-db/database/model/views/M_INOUT_HEADER_V.xml
src-db/database/model/views/M_INOUT_HEADER_VT.xml
src-db/database/model/views/M_INOUT_LINE_V.xml
src-db/database/model/views/M_INOUT_LINE_VT.xml
src-db/database/model/views/REPORT_PROJECTPROPOSAL.xml
src-db/database/model/views/RV_ASSET_CUSTOMER.xml
src-db/database/model/views/RV_ASSET_DELIVERY.xml
src-db/database/model/views/RV_BPARTNER.xml
src-db/database/model/views/RV_CASH_DETAIL.xml
src-db/database/model/views/RV_C_INVOICE.xml
src-db/database/model/views/RV_C_INVOICELINE.xml
src-db/database/model/views/RV_C_INVOICE_CUSTOMERPRODQTR.xml
src-db/database/model/views/RV_C_INVOICE_CUSTOMERVENDQTR.xml
src-db/database/model/views/RV_C_INVOICE_DAY.xml
src-db/database/model/views/RV_C_INVOICE_MONTH.xml
src-db/database/model/views/RV_C_INVOICE_PRODMONTH.xml
src-db/database/model/views/RV_C_INVOICE_PRODWEEK.xml
src-db/database/model/views/RV_C_INVOICE_VENDORMONTH.xml
src-db/database/model/views/RV_C_INVOICE_WEEK.xml
src-db/database/model/views/RV_M_TRANSACTION.xml
src-db/database/model/views/RV_M_TRANSACTION_SUM.xml
src-db/database/model/views/RV_ORDER_OPEN.xml
src-db/database/model/views/RV_PRODUCT_COSTING.xml
src-db/database/model/views/RV_PROJECTCYCLE.xml
src-db/database/model/views/R_REQUEST_V.xml
src-db/database/model/views/S_TIMEEXPENSELINE_V.xml
--- a/src-db/database/model/views/AD_FIELD_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/AD_FIELD_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,13 +1,12 @@
 <?xml version="1.0"?>
   <database name="VIEW AD_FIELD_V">
     <view name="AD_FIELD_V"><![CDATA[SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, f.name, f.description, f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, c.columnname, c.fieldlength, c.vformat, c.defaultvalue, c.iskey, c.isparent, c.ismandatory, c.isidentifier, c.istranslated, c.ad_reference_value_id, c.callout, c.ad_reference_id, c.ad_val_rule_id, c.ad_process_id, c.readonlylogic, c.isupdateable, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fg.name AS fieldgroup, vr.code AS validationcode
-FROM ad_field f
-JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
-LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
-LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
-JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
-JOIN ad_reference r ON c.ad_reference_id = r.ad_reference_id
-LEFT JOIN ad_val_rule vr ON c.ad_val_rule_id = vr.ad_val_rule_id
-WHERE f.isactive = 'Y' AND c.isactive = 'Y'
-]]></view>
+   FROM ad_field f
+   JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
+   LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
+   LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
+   JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
+   JOIN ad_reference r ON c.ad_reference_id = r.ad_reference_id
+   LEFT JOIN ad_val_rule vr ON c.ad_val_rule_id = vr.ad_val_rule_id
+  WHERE f.isactive = 'Y' AND c.isactive = 'Y']]></view>
   </database>
--- a/src-db/database/model/views/AD_FIELD_VT.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/AD_FIELD_VT.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,14 +1,13 @@
 <?xml version="1.0"?>
   <database name="VIEW AD_FIELD_VT">
     <view name="AD_FIELD_VT"><![CDATA[SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, trl.name, trl.description, trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, c.columnname, c.fieldlength, c.vformat, c.defaultvalue, c.iskey, c.isparent, c.ismandatory, c.isidentifier, c.istranslated, c.ad_reference_value_id, c.callout, c.ad_reference_id, c.ad_val_rule_id, c.ad_process_id, c.readonlylogic, c.isupdateable, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode
-FROM ad_field f
-JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id
-JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
-LEFT JOIN ad_fieldgroup_trl fgt ON f.ad_fieldgroup_id = fgt.ad_fieldgroup_id AND trl.ad_language = fgt.ad_language
-LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
-JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
-JOIN ad_reference r ON c.ad_reference_id = r.ad_reference_id
-LEFT JOIN ad_val_rule vr ON c.ad_val_rule_id = vr.ad_val_rule_id
-WHERE f.isactive = 'Y' AND c.isactive = 'Y'
-]]></view>
+   FROM ad_field f
+   JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id
+   JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
+   LEFT JOIN ad_fieldgroup_trl fgt ON f.ad_fieldgroup_id = fgt.ad_fieldgroup_id AND trl.ad_language = fgt.ad_language
+   LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
+   JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
+   JOIN ad_reference r ON c.ad_reference_id = r.ad_reference_id
+   LEFT JOIN ad_val_rule vr ON c.ad_val_rule_id = vr.ad_val_rule_id
+  WHERE f.isactive = 'Y' AND c.isactive = 'Y']]></view>
   </database>
--- a/src-db/database/model/views/AD_INTEGER.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/AD_INTEGER.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,10 +1,9 @@
 <?xml version="1.0"?>
   <database name="VIEW AD_INTEGER">
     <view name="AD_INTEGER"><![CDATA[SELECT to_number(a.value) AS value
-FROM ( SELECT ( SELECT count(*) AS count
-FROM ad_element
-WHERE ad_element.ad_element_id <= e.ad_element_id) AS value
-FROM ad_element e) a
-WHERE a.value <= 1024
-]]></view>
+   FROM ( SELECT ( SELECT count(*) AS count
+                   FROM ad_element
+                  WHERE ad_element.ad_element_id <= e.ad_element_id) AS value
+           FROM ad_element e) a
+  WHERE a.value <= 1024]]></view>
   </database>
--- a/src-db/database/model/views/AD_REF_LIST_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/AD_REF_LIST_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,14 +1,13 @@
 <?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
+   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>
+ 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	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/AD_TABLE_POST_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,27 +1,26 @@
 <?xml version="1.0"?>
   <database name="VIEW AD_TABLE_POST_V">
     <view name="AD_TABLE_POST_V"><![CDATA[SELECT ad_table.ad_table_id, (w2.name || 
-CASE
-WHEN w2.name IS NULL THEN ''
-ELSE ' - '
-END) || 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.version, c.entitytype, 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.issyncdatabase, 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'
+        CASE
+            WHEN w2.name IS NULL THEN ''
+            ELSE ' - '
+        END) || 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.version, c.entitytype, 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.issyncdatabase, 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, (w2.name || 
-CASE
-WHEN w2.name IS NULL THEN ''
-ELSE ' - '
-END) || 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.version, c.entitytype, 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.issyncdatabase, 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>
+ SELECT ad_table.ad_table_id, (w2.name || 
+        CASE
+            WHEN w2.name IS NULL THEN ''
+            ELSE ' - '
+        END) || 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.version, c.entitytype, 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.issyncdatabase, 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/AD_TAB_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/AD_TAB_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,8 +1,7 @@
 <?xml version="1.0"?>
   <database name="VIEW AD_TAB_V">
     <view name="AD_TAB_V"><![CDATA[SELECT t.ad_tab_id, t.ad_window_id, t.ad_table_id, t.name, t.description, t.help, t.seqno, t.issinglerow, t.hastree, t.isinfotab, tbl.replicationtype, tbl.tablename, tbl.accesslevel, tbl.issecurityenabled, tbl.isdeleteable, tbl.ishighvolume, tbl.isview, to_char('N') AS hasassociation, t.istranslationtab, t.isreadonly, t.ad_image_id, t.tablevel, t.whereclause, t.orderbyclause, t.commitwarning, t.ad_column_id, t.ad_process_id, t.issorttab, t.ad_columnsortorder_id, t.ad_columnsortyesno_id, t.included_tab_id
-FROM ad_tab t
-JOIN ad_table tbl ON t.ad_table_id = tbl.ad_table_id
-WHERE t.isactive = 'Y' AND tbl.isactive = 'Y'
-]]></view>
+   FROM ad_tab t
+   JOIN ad_table tbl ON t.ad_table_id = tbl.ad_table_id
+  WHERE t.isactive = 'Y' AND tbl.isactive = 'Y']]></view>
   </database>
--- a/src-db/database/model/views/AD_TAB_VT.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/AD_TAB_VT.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,9 +1,8 @@
 <?xml version="1.0"?>
   <database name="VIEW AD_TAB_VT">
     <view name="AD_TAB_VT"><![CDATA[SELECT trl.ad_language, t.ad_tab_id, t.ad_window_id, t.ad_table_id, trl.name, trl.description, trl.help, t.seqno, t.issinglerow, t.hastree, t.isinfotab, tbl.replicationtype, tbl.tablename, tbl.accesslevel, tbl.issecurityenabled, tbl.isdeleteable, tbl.ishighvolume, tbl.isview, to_char('N') AS hasassociation, t.istranslationtab, t.isreadonly, t.ad_image_id, t.tablevel, t.whereclause, t.orderbyclause, t.commitwarning, t.ad_column_id, t.ad_process_id, t.issorttab, t.ad_columnsortorder_id, t.ad_columnsortyesno_id, t.included_tab_id
-FROM ad_tab t
-JOIN ad_table tbl ON t.ad_table_id = tbl.ad_table_id
-JOIN ad_tab_trl trl ON t.ad_tab_id = trl.ad_tab_id
-WHERE t.isactive = 'Y' AND tbl.isactive = 'Y'
-]]></view>
+   FROM ad_tab t
+   JOIN ad_table tbl ON t.ad_table_id = tbl.ad_table_id
+   JOIN ad_tab_trl trl ON t.ad_tab_id = trl.ad_tab_id
+  WHERE t.isactive = 'Y' AND tbl.isactive = 'Y']]></view>
   </database>
--- a/src-db/database/model/views/AD_USER_ROLES_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/AD_USER_ROLES_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,8 +1,7 @@
 <?xml version="1.0"?>
   <database name="VIEW AD_USER_ROLES_V">
     <view name="AD_USER_ROLES_V"><![CDATA[SELECT u.name, r.name AS rolename
-FROM ad_user_roles ur
-JOIN ad_user u ON ur.ad_user_id = u.ad_user_id
-JOIN ad_role r ON ur.ad_role_id = r.ad_role_id
-]]></view>
+   FROM ad_user_roles ur
+   JOIN ad_user u ON ur.ad_user_id = u.ad_user_id
+   JOIN ad_role r ON ur.ad_role_id = r.ad_role_id]]></view>
   </database>
--- a/src-db/database/model/views/AD_WINDOW_VT.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/AD_WINDOW_VT.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,8 +1,7 @@
 <?xml version="1.0"?>
   <database name="VIEW AD_WINDOW_VT">
     <view name="AD_WINDOW_VT"><![CDATA[SELECT trl.ad_language, bt.ad_window_id, trl.name, trl.description, trl.help, bt.windowtype, bt.ad_color_id, bt.ad_image_id, bt.isactive
-FROM ad_window bt
-JOIN ad_window_trl trl ON bt.ad_window_id = trl.ad_window_id
-WHERE bt.isactive = 'Y'
-]]></view>
+   FROM ad_window bt
+   JOIN ad_window_trl trl ON bt.ad_window_id = trl.ad_window_id
+  WHERE bt.isactive = 'Y']]></view>
   </database>
--- a/src-db/database/model/views/A_ASSET_AMORTIZATION.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/A_ASSET_AMORTIZATION.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,7 +1,6 @@
 <?xml version="1.0"?>
   <database name="VIEW A_ASSET_AMORTIZATION">
     <view name="A_ASSET_AMORTIZATION"><![CDATA[SELECT a_asset.ad_client_id, a_asset.ad_org_id, a_asset.isactive, a_asset.created, a_asset.createdby, a_asset.updated, a_asset.updatedby, a_asset.a_asset_id, a_amortization.a_amortization_id, a_amortization.startdate, a_amortization.enddate, a_amortizationline.amortization_porcentage, a_amortizationline.amortizationamt
-FROM a_asset, a_amortization, a_amortizationline
-WHERE a_asset.a_asset_id = a_amortizationline.a_asset_id AND a_amortizationline.a_amortization_id = a_amortization.a_amortization_id
-]]></view>
+   FROM a_asset, a_amortization, a_amortizationline
+  WHERE a_asset.a_asset_id = a_amortizationline.a_asset_id AND a_amortizationline.a_amortization_id = a_amortization.a_amortization_id]]></view>
   </database>
--- a/src-db/database/model/views/C_DEBT_PAYMENT_CANCEL.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_DEBT_PAYMENT_CANCEL.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,7 +1,6 @@
 <?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
-FROM c_debt_payment
-WHERE c_debt_payment.c_settlement_cancel_id IS NOT NULL
-]]></view>
+   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	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_DEBT_PAYMENT_GENERATE.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,7 +1,6 @@
 <?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>
+   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	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_DEBT_PAYMENT_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,18 +1,17 @@
 <?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, 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, 
-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, c_debt_payment.glitemamt, c_debt_payment.c_order_id, c_debt_payment.status
-FROM c_debt_payment
-]]></view>
+        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, c_debt_payment.glitemamt, c_debt_payment.c_order_id, c_debt_payment.status
+   FROM c_debt_payment]]></view>
   </database>
--- a/src-db/database/model/views/C_INVOICELINE_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_INVOICELINE_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,15 +1,14 @@
 <?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>
+        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_INVOICE_CANDIDATE_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_INVOICE_CANDIDATE_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,13 +1,12 @@
 <?xml version="1.0"?>
   <database name="VIEW C_INVOICE_CANDIDATE_V">
     <view name="C_INVOICE_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.qtyinvoiced) * l.priceactual) AS totallines
-FROM c_order o
-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
-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 l.qtyordered <> l.qtyinvoiced AND (o.invoicerule = 'I' OR o.invoicerule = 'O' OR o.invoicerule = 'N' OR o.invoicerule = 'D' AND l.qtyinvoiced <> l.qtydelivered OR o.invoicerule = 'S' AND bp.c_invoiceschedule_id IS NULL OR o.invoicerule = 'S' AND bp.c_invoiceschedule_id IS NOT NULL 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)))
-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
-]]></view>
+   FROM c_order o
+   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
+   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 l.qtyordered <> l.qtyinvoiced AND (o.invoicerule = 'I' OR o.invoicerule = 'O' OR o.invoicerule = 'N' OR o.invoicerule = 'D' AND l.qtyinvoiced <> l.qtydelivered OR o.invoicerule = 'S' AND bp.c_invoiceschedule_id IS NULL OR o.invoicerule = 'S' AND bp.c_invoiceschedule_id IS NOT NULL 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)))
+  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]]></view>
   </database>
--- a/src-db/database/model/views/C_INVOICE_HEADER_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_INVOICE_HEADER_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,16 +1,15 @@
 <?xml version="1.0"?>
   <database name="VIEW C_INVOICE_HEADER_V">
     <view name="C_INVOICE_HEADER_V"><![CDATA[SELECT i.ad_client_id, i.ad_org_id, i.isactive, i.created, i.createdby, i.updated, i.updatedby, to_char('en_US') AS ad_language, i.c_invoice_id, i.issotrx, i.documentno, i.docstatus, i.c_doctype_id, i.c_bpartner_id, bp.value AS bpvalue, oi.c_location_id AS org_location_id, oi.taxid, dt.printname AS documenttype, dt.documentnote AS documenttypenote, i.c_order_id, i.salesrep_id, COALESCE(ubp.name, u.name) AS salesrep_name, i.dateinvoiced, bpg.name AS bpgreeting, bp.name, bp.name2, bpcg.name AS bpcontactgreeting, bpc.title, NULLIF(bpc.name, bp.name) AS contactname, bpl.c_location_id, bp.referenceno, i.description, i.poreference, i.dateordered, i.c_currency_id, pt.name AS paymentterm, pt.documentnote AS paymenttermnote, i.c_charge_id, i.chargeamt, i.totallines, i.grandtotal, i.m_pricelist_id, i.istaxincluded, i.c_campaign_id, i.c_project_id, i.c_activity_id, i.ispaid
-FROM c_invoice i
-JOIN c_doctype dt ON i.c_doctype_id = dt.c_doctype_id
-JOIN c_paymentterm pt ON i.c_paymentterm_id = pt.c_paymentterm_id
-JOIN c_bpartner bp ON i.c_bpartner_id = bp.c_bpartner_id
-LEFT JOIN c_greeting bpg ON bp.c_greeting_id = bpg.c_greeting_id
-JOIN c_bpartner_location bpl ON i.c_bpartner_location_id = bpl.c_bpartner_location_id
-LEFT JOIN ad_user bpc ON i.ad_user_id = bpc.ad_user_id
-LEFT JOIN c_greeting bpcg ON bpc.c_greeting_id = bpcg.c_greeting_id
-JOIN ad_orginfo oi ON i.ad_org_id = oi.ad_org_id
-LEFT JOIN ad_user u ON i.salesrep_id = u.ad_user_id
-LEFT JOIN c_bpartner ubp ON u.c_bpartner_id = ubp.c_bpartner_id
-]]></view>
+   FROM c_invoice i
+   JOIN c_doctype dt ON i.c_doctype_id = dt.c_doctype_id
+   JOIN c_paymentterm pt ON i.c_paymentterm_id = pt.c_paymentterm_id
+   JOIN c_bpartner bp ON i.c_bpartner_id = bp.c_bpartner_id
+   LEFT JOIN c_greeting bpg ON bp.c_greeting_id = bpg.c_greeting_id
+   JOIN c_bpartner_location bpl ON i.c_bpartner_location_id = bpl.c_bpartner_location_id
+   LEFT JOIN ad_user bpc ON i.ad_user_id = bpc.ad_user_id
+   LEFT JOIN c_greeting bpcg ON bpc.c_greeting_id = bpcg.c_greeting_id
+   JOIN ad_orginfo oi ON i.ad_org_id = oi.ad_org_id
+   LEFT JOIN ad_user u ON i.salesrep_id = u.ad_user_id
+   LEFT JOIN c_bpartner ubp ON u.c_bpartner_id = ubp.c_bpartner_id]]></view>
   </database>
--- a/src-db/database/model/views/C_INVOICE_HEADER_VT.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_INVOICE_HEADER_VT.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,16 +1,15 @@
 <?xml version="1.0"?>
   <database name="VIEW C_INVOICE_HEADER_VT">
     <view name="C_INVOICE_HEADER_VT"><![CDATA[SELECT i.ad_client_id, i.ad_org_id, i.isactive, i.created, i.createdby, i.updated, i.updatedby, dt.ad_language, i.c_invoice_id, i.issotrx, i.documentno, i.docstatus, i.c_doctype_id, i.c_bpartner_id, bp.value AS bpvalue, oi.c_location_id AS org_location_id, oi.taxid, dt.printname AS documenttype, dt.documentnote AS documenttypenote, i.c_order_id, i.salesrep_id, COALESCE(ubp.name, u.name) AS salesrep_name, i.dateinvoiced, bpg.name AS bpgreeting, bp.name, bp.name2, bpcg.name AS bpcontactgreeting, bpc.title, NULLIF(bpc.name, bp.name) AS contactname, bpl.c_location_id, bp.referenceno, i.description, i.poreference, i.dateordered, i.c_currency_id, pt.name AS paymentterm, pt.documentnote AS paymenttermnote, i.c_charge_id, i.chargeamt, i.totallines, i.grandtotal, i.m_pricelist_id, i.istaxincluded, i.c_campaign_id, i.c_project_id, i.c_activity_id, i.ispaid
-FROM c_invoice i
-JOIN c_doctype_trl dt ON i.c_doctype_id = dt.c_doctype_id
-JOIN c_paymentterm_trl pt ON i.c_paymentterm_id = pt.c_paymentterm_id AND dt.ad_language = pt.ad_language
-JOIN c_bpartner bp ON i.c_bpartner_id = bp.c_bpartner_id
-LEFT JOIN c_greeting_trl bpg ON bp.c_greeting_id = bpg.c_greeting_id AND dt.ad_language = bpg.ad_language
-JOIN c_bpartner_location bpl ON i.c_bpartner_location_id = bpl.c_bpartner_location_id
-LEFT JOIN ad_user bpc ON i.ad_user_id = bpc.ad_user_id
-LEFT JOIN c_greeting_trl bpcg ON bpc.c_greeting_id = bpcg.c_greeting_id AND dt.ad_language = bpcg.ad_language
-JOIN ad_orginfo oi ON i.ad_org_id = oi.ad_org_id
-LEFT JOIN ad_user u ON i.salesrep_id = u.ad_user_id
-LEFT JOIN c_bpartner ubp ON u.c_bpartner_id = ubp.c_bpartner_id
-]]></view>
+   FROM c_invoice i
+   JOIN c_doctype_trl dt ON i.c_doctype_id = dt.c_doctype_id
+   JOIN c_paymentterm_trl pt ON i.c_paymentterm_id = pt.c_paymentterm_id AND dt.ad_language = pt.ad_language
+   JOIN c_bpartner bp ON i.c_bpartner_id = bp.c_bpartner_id
+   LEFT JOIN c_greeting_trl bpg ON bp.c_greeting_id = bpg.c_greeting_id AND dt.ad_language = bpg.ad_language
+   JOIN c_bpartner_location bpl ON i.c_bpartner_location_id = bpl.c_bpartner_location_id
+   LEFT JOIN ad_user bpc ON i.ad_user_id = bpc.ad_user_id
+   LEFT JOIN c_greeting_trl bpcg ON bpc.c_greeting_id = bpcg.c_greeting_id AND dt.ad_language = bpcg.ad_language
+   JOIN ad_orginfo oi ON i.ad_org_id = oi.ad_org_id
+   LEFT JOIN ad_user u ON i.salesrep_id = u.ad_user_id
+   LEFT JOIN c_bpartner ubp ON u.c_bpartner_id = ubp.c_bpartner_id]]></view>
   </database>
--- a/src-db/database/model/views/C_INVOICE_LINETAX_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_INVOICE_LINETAX_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,56 +1,55 @@
 <?xml version="1.0"?>
   <database name="VIEW C_INVOICE_LINETAX_V">
     <view name="C_INVOICE_LINETAX_V"><![CDATA[((( SELECT il.ad_client_id, il.ad_org_id, il.isactive, il.created, il.createdby, il.updated, il.updatedby, 'en_US' AS ad_language, il.c_invoice_id, il.c_invoiceline_id, il.c_tax_id, il.line, 
-CASE
-WHEN il.qtyinvoiced <> 0 OR il.m_product_id IS NOT NULL THEN il.qtyinvoiced
-ELSE NULL
-END AS qtyinvoiced, 
-CASE
-WHEN il.qtyinvoiced <> 0 OR il.m_product_id IS NOT NULL THEN uom.uomsymbol
-ELSE NULL
-END AS uomsymbol, COALESCE(p.name, il.description) AS name, 
-CASE
-WHEN p.name IS NOT NULL THEN il.description
-ELSE NULL
-END AS description, p.documentnote, p.upc, p.sku, p.value AS productvalue, ra.description AS resourcedescription, 
-CASE
-WHEN i.isdiscountprinted = 'Y' AND (il.pricelist <> 0 OR il.m_product_id IS NOT NULL) THEN il.pricelist
-ELSE NULL
-END AS pricelist, 
-CASE
-WHEN i.isdiscountprinted = 'Y' AND il.pricelist > il.priceactual THEN (il.pricelist - il.priceactual) / il.pricelist * 100
-ELSE NULL
-END AS discount, 
-CASE
-WHEN il.priceactual <> 0 OR il.m_product_id IS NOT NULL THEN il.priceactual
-ELSE NULL
-END AS priceactual, 
-CASE
-WHEN il.linenetamt <> 0 OR il.m_product_id IS NOT NULL THEN il.linenetamt
-ELSE NULL
-END AS linenetamt
-FROM c_invoiceline il
-JOIN c_uom uom ON il.c_uom_id = uom.c_uom_id
-JOIN c_invoice i ON il.c_invoice_id = i.c_invoice_id
-LEFT JOIN m_product p ON il.m_product_id = p.m_product_id
-LEFT JOIN s_resourceassignment ra ON il.s_resourceassignment_id = ra.s_resourceassignment_id
+        CASE
+            WHEN il.qtyinvoiced <> 0 OR il.m_product_id IS NOT NULL THEN il.qtyinvoiced
+            ELSE NULL
+        END AS qtyinvoiced, 
+        CASE
+            WHEN il.qtyinvoiced <> 0 OR il.m_product_id IS NOT NULL THEN uom.uomsymbol
+            ELSE NULL
+        END AS uomsymbol, COALESCE(p.name, il.description) AS name, 
+        CASE
+            WHEN p.name IS NOT NULL THEN il.description
+            ELSE NULL
+        END AS description, p.documentnote, p.upc, p.sku, p.value AS productvalue, ra.description AS resourcedescription, 
+        CASE
+            WHEN i.isdiscountprinted = 'Y' AND (il.pricelist <> 0 OR il.m_product_id IS NOT NULL) THEN il.pricelist
+            ELSE NULL
+        END AS pricelist, 
+        CASE
+            WHEN i.isdiscountprinted = 'Y' AND il.pricelist > il.priceactual THEN (il.pricelist - il.priceactual) / il.pricelist * 100
+            ELSE NULL
+        END AS discount, 
+        CASE
+            WHEN il.priceactual <> 0 OR il.m_product_id IS NOT NULL THEN il.priceactual
+            ELSE NULL
+        END AS priceactual, 
+        CASE
+            WHEN il.linenetamt <> 0 OR il.m_product_id IS NOT NULL THEN il.linenetamt
+            ELSE NULL
+        END AS linenetamt
+   FROM c_invoiceline il
+   JOIN c_uom uom ON il.c_uom_id = uom.c_uom_id
+   JOIN c_invoice i ON il.c_invoice_id = i.c_invoice_id
+   LEFT JOIN m_product p ON il.m_product_id = p.m_product_id
+   LEFT JOIN s_resourceassignment ra ON il.s_resourceassignment_id = ra.s_resourceassignment_id
 UNION 
-SELECT il.ad_client_id, il.ad_org_id, il.isactive, il.created, il.createdby, il.updated, il.updatedby, 'en_US' AS ad_language, il.c_invoice_id, il.c_invoiceline_id, il.c_tax_id, il.line + b.line / 100 AS line, il.qtyinvoiced * b.bomqty AS qtyinvoiced, uom.uomsymbol, p.name, b.description, p.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_invoiceline il ON b.m_product_id = il.m_product_id
-JOIN m_product bp ON bp.m_product_id = il.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 uom ON p.c_uom_id = uom.c_uom_id)
+ SELECT il.ad_client_id, il.ad_org_id, il.isactive, il.created, il.createdby, il.updated, il.updatedby, 'en_US' AS ad_language, il.c_invoice_id, il.c_invoiceline_id, il.c_tax_id, il.line + b.line / 100 AS line, il.qtyinvoiced * b.bomqty AS qtyinvoiced, uom.uomsymbol, p.name, b.description, p.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_invoiceline il ON b.m_product_id = il.m_product_id
+   JOIN m_product bp ON bp.m_product_id = il.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 uom ON p.c_uom_id = uom.c_uom_id)
 UNION 
-SELECT il.ad_client_id, il.ad_org_id, il.isactive, il.created, il.createdby, il.updated, il.updatedby, 'en_US' AS ad_language, il.c_invoice_id, il.c_invoiceline_id, il.c_tax_id, il.line, NULL AS qtyinvoiced, NULL AS uomsymbol, il.description 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_invoiceline il
-WHERE il.c_uom_id IS NULL)
+ SELECT il.ad_client_id, il.ad_org_id, il.isactive, il.created, il.createdby, il.updated, il.updatedby, 'en_US' AS ad_language, il.c_invoice_id, il.c_invoiceline_id, il.c_tax_id, il.line, NULL AS qtyinvoiced, NULL AS uomsymbol, il.description 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_invoiceline il
+  WHERE il.c_uom_id IS NULL)
 UNION 
-SELECT c_invoice.ad_client_id, c_invoice.ad_org_id, c_invoice.isactive, c_invoice.created, c_invoice.createdby, c_invoice.updated, c_invoice.updatedby, 'en_US' AS ad_language, c_invoice.c_invoice_id, NULL AS c_invoiceline_id, NULL AS c_tax_id, 9998 AS line, NULL AS qtyinvoiced, 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_invoice)
+ SELECT c_invoice.ad_client_id, c_invoice.ad_org_id, c_invoice.isactive, c_invoice.created, c_invoice.createdby, c_invoice.updated, c_invoice.updatedby, 'en_US' AS ad_language, c_invoice.c_invoice_id, NULL AS c_invoiceline_id, NULL AS c_tax_id, 9998 AS line, NULL AS qtyinvoiced, 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_invoice)
 UNION 
-SELECT it.ad_client_id, it.ad_org_id, it.isactive, it.created, it.createdby, it.updated, it.updatedby, 'en_US' AS ad_language, it.c_invoice_id, NULL AS c_invoiceline_id, it.c_tax_id, 9999 AS line, NULL AS qtyinvoiced, 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, it.taxbaseamt AS priceactual, it.taxamt AS linenetamt
-FROM c_invoicetax it
-JOIN c_tax t ON it.c_tax_id = t.c_tax_id
-]]></view>
+ SELECT it.ad_client_id, it.ad_org_id, it.isactive, it.created, it.createdby, it.updated, it.updatedby, 'en_US' AS ad_language, it.c_invoice_id, NULL AS c_invoiceline_id, it.c_tax_id, 9999 AS line, NULL AS qtyinvoiced, 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, it.taxbaseamt AS priceactual, it.taxamt AS linenetamt
+   FROM c_invoicetax it
+   JOIN c_tax t ON it.c_tax_id = t.c_tax_id]]></view>
   </database>
--- a/src-db/database/model/views/C_INVOICE_LINETAX_VT.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_INVOICE_LINETAX_VT.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,60 +1,59 @@
 <?xml version="1.0"?>
   <database name="VIEW C_INVOICE_LINETAX_VT">
     <view name="C_INVOICE_LINETAX_VT"><![CDATA[((( SELECT il.ad_client_id, il.ad_org_id, il.isactive, il.created, il.createdby, il.updated, il.updatedby, uom.ad_language, il.c_invoice_id, il.c_invoiceline_id, il.c_tax_id, il.line, 
-CASE
-WHEN il.qtyinvoiced <> 0 OR il.m_product_id IS NOT NULL THEN il.qtyinvoiced
-ELSE NULL
-END AS qtyinvoiced, 
-CASE
-WHEN il.qtyinvoiced <> 0 OR il.m_product_id IS NOT NULL THEN uom.uomsymbol
-ELSE NULL
-END AS uomsymbol, COALESCE(COALESCE(pt.name, p.name), il.description) AS name, 
-CASE
-WHEN COALESCE(pt.name, p.name) IS NOT NULL THEN il.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' AND (il.pricelist <> 0 OR il.m_product_id IS NOT NULL) THEN il.pricelist
-ELSE NULL
-END AS pricelist, 
-CASE
-WHEN i.isdiscountprinted = 'Y' AND il.pricelist > il.priceactual THEN (il.pricelist - il.priceactual) / il.pricelist * 100
-ELSE NULL
-END AS discount, 
-CASE
-WHEN il.priceactual <> 0 OR il.m_product_id IS NOT NULL THEN il.priceactual
-ELSE NULL
-END AS priceactual, 
-CASE
-WHEN il.linenetamt <> 0 OR il.m_product_id IS NOT NULL THEN il.linenetamt
-ELSE NULL
-END AS linenetamt
-FROM c_invoiceline il
-JOIN c_uom_trl uom ON il.c_uom_id = uom.c_uom_id
-JOIN c_invoice i ON il.c_invoice_id = i.c_invoice_id
-LEFT JOIN m_product p ON il.m_product_id = p.m_product_id
-LEFT JOIN m_product_trl pt ON il.m_product_id = pt.m_product_id AND uom.ad_language = pt.ad_language
-LEFT JOIN s_resourceassignment ra ON il.s_resourceassignment_id = ra.s_resourceassignment_id
+        CASE
+            WHEN il.qtyinvoiced <> 0 OR il.m_product_id IS NOT NULL THEN il.qtyinvoiced
+            ELSE NULL
+        END AS qtyinvoiced, 
+        CASE
+            WHEN il.qtyinvoiced <> 0 OR il.m_product_id IS NOT NULL THEN uom.uomsymbol
+            ELSE NULL
+        END AS uomsymbol, COALESCE(COALESCE(pt.name, p.name), il.description) AS name, 
+        CASE
+            WHEN COALESCE(pt.name, p.name) IS NOT NULL THEN il.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' AND (il.pricelist <> 0 OR il.m_product_id IS NOT NULL) THEN il.pricelist
+            ELSE NULL
+        END AS pricelist, 
+        CASE
+            WHEN i.isdiscountprinted = 'Y' AND il.pricelist > il.priceactual THEN (il.pricelist - il.priceactual) / il.pricelist * 100
+            ELSE NULL
+        END AS discount, 
+        CASE
+            WHEN il.priceactual <> 0 OR il.m_product_id IS NOT NULL THEN il.priceactual
+            ELSE NULL
+        END AS priceactual, 
+        CASE
+            WHEN il.linenetamt <> 0 OR il.m_product_id IS NOT NULL THEN il.linenetamt
+            ELSE NULL
+        END AS linenetamt
+   FROM c_invoiceline il
+   JOIN c_uom_trl uom ON il.c_uom_id = uom.c_uom_id
+   JOIN c_invoice i ON il.c_invoice_id = i.c_invoice_id
+   LEFT JOIN m_product p ON il.m_product_id = p.m_product_id
+   LEFT JOIN m_product_trl pt ON il.m_product_id = pt.m_product_id AND uom.ad_language = pt.ad_language
+   LEFT JOIN s_resourceassignment ra ON il.s_resourceassignment_id = ra.s_resourceassignment_id
 UNION 
-SELECT il.ad_client_id, il.ad_org_id, il.isactive, il.created, il.createdby, il.updated, il.updatedby, uom.ad_language, il.c_invoice_id, il.c_invoiceline_id, il.c_tax_id, il.line + b.line / 100 AS line, il.qtyinvoiced * b.bomqty AS qtyinvoiced, 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_invoiceline il ON b.m_product_id = il.m_product_id
-JOIN m_product bp ON bp.m_product_id = il.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)
+ SELECT il.ad_client_id, il.ad_org_id, il.isactive, il.created, il.createdby, il.updated, il.updatedby, uom.ad_language, il.c_invoice_id, il.c_invoiceline_id, il.c_tax_id, il.line + b.line / 100 AS line, il.qtyinvoiced * b.bomqty AS qtyinvoiced, 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_invoiceline il ON b.m_product_id = il.m_product_id
+   JOIN m_product bp ON bp.m_product_id = il.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 il.ad_client_id, il.ad_org_id, il.isactive, il.created, il.createdby, il.updated, il.updatedby, l.ad_language, il.c_invoice_id, il.c_invoiceline_id, il.c_tax_id, il.line, NULL AS qtyinvoiced, NULL AS uomsymbol, il.description 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_invoiceline il, ad_language l
-WHERE il.c_uom_id IS NULL AND l.isbaselanguage = 'N' AND l.issystemlanguage = 'Y')
+ SELECT il.ad_client_id, il.ad_org_id, il.isactive, il.created, il.createdby, il.updated, il.updatedby, l.ad_language, il.c_invoice_id, il.c_invoiceline_id, il.c_tax_id, il.line, NULL AS qtyinvoiced, NULL AS uomsymbol, il.description 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_invoiceline il, ad_language l
+  WHERE il.c_uom_id IS NULL AND l.isbaselanguage = 'N' AND l.issystemlanguage = 'Y')
 UNION 
-SELECT i.ad_client_id, i.ad_org_id, i.isactive, i.created, i.createdby, i.updated, i.updatedby, l.ad_language, i.c_invoice_id, NULL AS c_invoiceline_id, NULL AS c_tax_id, 9998 AS line, NULL AS qtyinvoiced, 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_invoice i, ad_language l
-WHERE l.isbaselanguage = 'N' AND l.issystemlanguage = 'Y')
+ SELECT i.ad_client_id, i.ad_org_id, i.isactive, i.created, i.createdby, i.updated, i.updatedby, l.ad_language, i.c_invoice_id, NULL AS c_invoiceline_id, NULL AS c_tax_id, 9998 AS line, NULL AS qtyinvoiced, 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_invoice i, ad_language l
+  WHERE l.isbaselanguage = 'N' AND l.issystemlanguage = 'Y')
 UNION 
-SELECT it.ad_client_id, it.ad_org_id, it.isactive, it.created, it.createdby, it.updated, it.updatedby, l.ad_language, it.c_invoice_id, NULL AS c_invoiceline_id, it.c_tax_id, 9999 AS line, NULL AS qtyinvoiced, 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, it.taxbaseamt AS priceactual, it.taxamt AS linenetamt
-FROM c_invoicetax it
-JOIN c_tax t ON it.c_tax_id = t.c_tax_id, ad_language l
-WHERE l.isbaselanguage = 'N' AND l.issystemlanguage = 'Y'
-]]></view>
+ SELECT it.ad_client_id, it.ad_org_id, it.isactive, it.created, it.createdby, it.updated, it.updatedby, l.ad_language, it.c_invoice_id, NULL AS c_invoiceline_id, it.c_tax_id, 9999 AS line, NULL AS qtyinvoiced, 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, it.taxbaseamt AS priceactual, it.taxamt AS linenetamt
+   FROM c_invoicetax it
+   JOIN c_tax t ON it.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_INVOICE_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_INVOICE_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,27 +1,26 @@
 <?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.isapproved, i.istransferred, 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, i.ispaid, 
-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>
+        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_ORDER_HEADER_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_ORDER_HEADER_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,16 +1,15 @@
 <?xml version="1.0"?>
   <database name="VIEW C_ORDER_HEADER_V">
     <view name="C_ORDER_HEADER_V"><![CDATA[SELECT o.ad_client_id, o.ad_org_id, o.isactive, o.created, o.createdby, o.updated, o.updatedby, to_char('en_US') AS ad_language, o.c_order_id, o.issotrx, o.documentno, o.docstatus, o.c_doctype_id, o.c_bpartner_id, bp.value AS bpvalue, oi.c_location_id AS org_location_id, oi.taxid, dt.printname AS documenttype, dt.documentnote AS documenttypenote, o.salesrep_id, COALESCE(ubp.name, u.name) AS salesrep_name, o.dateordered, o.datepromised, bpg.name AS bpgreeting, bp.name, bp.name2, bpcg.name AS bpcontactgreeting, bpc.title, NULLIF(bpc.name, bp.name) AS contactname, bpl.c_location_id, bp.referenceno, o.description, o.poreference, o.c_currency_id, pt.name AS paymentterm, pt.documentnote AS paymenttermnote, o.c_charge_id, o.chargeamt, o.totallines, o.grandtotal, o.m_pricelist_id, o.istaxincluded, o.c_campaign_id, o.c_project_id, o.c_activity_id, o.m_shipper_id, o.deliveryrule, o.deliveryviarule, o.priorityrule, o.invoicerule
-FROM c_order o
-JOIN c_doctype dt ON o.c_doctype_id = dt.c_doctype_id
-JOIN c_paymentterm pt ON o.c_paymentterm_id = pt.c_paymentterm_id
-JOIN c_bpartner bp ON o.c_bpartner_id = bp.c_bpartner_id
-LEFT JOIN c_greeting bpg ON bp.c_greeting_id = bpg.c_greeting_id
-JOIN c_bpartner_location bpl ON o.c_bpartner_location_id = bpl.c_bpartner_location_id
-LEFT JOIN ad_user bpc ON o.ad_user_id = bpc.ad_user_id
-LEFT JOIN c_greeting bpcg ON bpc.c_greeting_id = bpcg.c_greeting_id
-JOIN ad_orginfo oi ON o.ad_org_id = oi.ad_org_id
-LEFT JOIN ad_user u ON o.salesrep_id = u.ad_user_id
-LEFT JOIN c_bpartner ubp ON u.c_bpartner_id = ubp.c_bpartner_id
-]]></view>
+   FROM c_order o
+   JOIN c_doctype dt ON o.c_doctype_id = dt.c_doctype_id
+   JOIN c_paymentterm pt ON o.c_paymentterm_id = pt.c_paymentterm_id
+   JOIN c_bpartner bp ON o.c_bpartner_id = bp.c_bpartner_id
+   LEFT JOIN c_greeting bpg ON bp.c_greeting_id = bpg.c_greeting_id
+   JOIN c_bpartner_location bpl ON o.c_bpartner_location_id = bpl.c_bpartner_location_id
+   LEFT JOIN ad_user bpc ON o.ad_user_id = bpc.ad_user_id
+   LEFT JOIN c_greeting bpcg ON bpc.c_greeting_id = bpcg.c_greeting_id
+   JOIN ad_orginfo oi ON o.ad_org_id = oi.ad_org_id
+   LEFT JOIN ad_user u ON o.salesrep_id = u.ad_user_id
+   LEFT JOIN c_bpartner ubp ON u.c_bpartner_id = ubp.c_bpartner_id]]></view>
   </database>
--- a/src-db/database/model/views/C_ORDER_HEADER_VT.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_ORDER_HEADER_VT.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,16 +1,15 @@
 <?xml version="1.0"?>
   <database name="VIEW C_ORDER_HEADER_VT">
     <view name="C_ORDER_HEADER_VT"><![CDATA[SELECT o.ad_client_id, o.ad_org_id, o.isactive, o.created, o.createdby, o.updated, o.updatedby, dt.ad_language, o.c_order_id, o.issotrx, o.documentno, o.docstatus, o.c_doctype_id, o.c_bpartner_id, bp.value AS bpvalue, oi.c_location_id AS org_location_id, oi.taxid, dt.printname AS documenttype, dt.documentnote AS documenttypenote, o.salesrep_id, COALESCE(ubp.name, u.name) AS salesrep_name, o.dateordered, o.datepromised, bpg.name AS bpgreeting, bp.name, bp.name2, bpcg.name AS bpcontactgreeting, bpc.title, NULLIF(bpc.name, bp.name) AS contactname, bpl.c_location_id, bp.referenceno, o.description, o.poreference, o.c_currency_id, pt.name AS paymentterm, pt.documentnote AS paymenttermnote, o.c_charge_id, o.chargeamt, o.totallines, o.grandtotal, o.m_pricelist_id, o.istaxincluded, o.c_campaign_id, o.c_project_id, o.c_activity_id, o.m_shipper_id, o.deliveryrule, o.deliveryviarule, o.priorityrule, o.invoicerule
-FROM c_order o
-JOIN c_doctype_trl dt ON o.c_doctype_id = dt.c_doctype_id
-JOIN c_paymentterm_trl pt ON o.c_paymentterm_id = pt.c_paymentterm_id AND dt.ad_language = pt.ad_language
-JOIN c_bpartner bp ON o.c_bpartner_id = bp.c_bpartner_id
-LEFT JOIN c_greeting_trl bpg ON bp.c_greeting_id = bpg.c_greeting_id AND dt.ad_language = bpg.ad_language
-JOIN c_bpartner_location bpl ON o.c_bpartner_location_id = bpl.c_bpartner_location_id
-LEFT JOIN ad_user bpc ON o.ad_user_id = bpc.ad_user_id
-LEFT JOIN c_greeting_trl bpcg ON bpc.c_greeting_id = bpcg.c_greeting_id AND dt.ad_language = bpcg.ad_language
-JOIN ad_orginfo oi ON o.ad_org_id = oi.ad_org_id
-LEFT JOIN ad_user u ON o.salesrep_id = u.ad_user_id
-LEFT JOIN c_bpartner ubp ON u.c_bpartner_id = ubp.c_bpartner_id
-]]></view>
+   FROM c_order o
+   JOIN c_doctype_trl dt ON o.c_doctype_id = dt.c_doctype_id
+   JOIN c_paymentterm_trl pt ON o.c_paymentterm_id = pt.c_paymentterm_id AND dt.ad_language = pt.ad_language
+   JOIN c_bpartner bp ON o.c_bpartner_id = bp.c_bpartner_id
+   LEFT JOIN c_greeting_trl bpg ON bp.c_greeting_id = bpg.c_greeting_id AND dt.ad_language = bpg.ad_language
+   JOIN c_bpartner_location bpl ON o.c_bpartner_location_id = bpl.c_bpartner_location_id
+   LEFT JOIN ad_user bpc ON o.ad_user_id = bpc.ad_user_id
+   LEFT JOIN c_greeting_trl bpcg ON bpc.c_greeting_id = bpcg.c_greeting_id AND dt.ad_language = bpcg.ad_language
+   JOIN ad_orginfo oi ON o.ad_org_id = oi.ad_org_id
+   LEFT JOIN ad_user u ON o.salesrep_id = u.ad_user_id
+   LEFT JOIN c_bpartner ubp ON u.c_bpartner_id = ubp.c_bpartner_id]]></view>
   </database>
--- a/src-db/database/model/views/C_ORDER_LINETAX_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_ORDER_LINETAX_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,36 +1,35 @@
 <?xml version="1.0"?>
   <database name="VIEW C_ORDER_LINETAX_V">
     <view name="C_ORDER_LINETAX_V"><![CDATA[(( SELECT ol.ad_client_id, ol.ad_org_id, ol.isactive, ol.created, ol.createdby, ol.updated, ol.updatedby, 'en_US' AS ad_language, ol.c_order_id, ol.c_orderline_id, ol.c_tax_id, ol.line, ol.qtyordered, uom.uomsymbol, COALESCE(p.name, ol.description) AS name, 
-CASE
-WHEN p.name IS NOT NULL THEN ol.description
-ELSE NULL
-END AS description, p.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 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 s_resourceassignment ra ON ol.s_resourceassignment_id = ra.s_resourceassignment_id
+        CASE
+            WHEN p.name IS NOT NULL THEN ol.description
+            ELSE NULL
+        END AS description, p.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 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 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, 'en_US' AS 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, p.name, b.description, p.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 uom ON p.c_uom_id = uom.c_uom_id)
+ SELECT ol.ad_client_id, ol.ad_org_id, ol.isactive, ol.created, ol.createdby, ol.updated, ol.updatedby, 'en_US' AS 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, p.name, b.description, p.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 uom ON p.c_uom_id = uom.c_uom_id)
 UNION 
-SELECT c_order.ad_client_id, c_order.ad_org_id, c_order.isactive, c_order.created, c_order.createdby, c_order.updated, c_order.updatedby, 'en_US' AS ad_language, c_order.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)
+ SELECT c_order.ad_client_id, c_order.ad_org_id, c_order.isactive, c_order.created, c_order.createdby, c_order.updated, c_order.updatedby, 'en_US' AS ad_language, c_order.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)
 UNION 
-SELECT ot.ad_client_id, ot.ad_org_id, ot.isactive, ot.created, ot.createdby, ot.updated, ot.updatedby, 'en_US' AS 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
-]]></view>
+ SELECT ot.ad_client_id, ot.ad_org_id, ot.isactive, ot.created, ot.createdby, ot.updated, ot.updatedby, 'en_US' AS 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]]></view>
   </database>
--- a/src-db/database/model/views/C_ORDER_LINETAX_VT.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_ORDER_LINETAX_VT.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,40 +1,39 @@
 <?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
+        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)
+ 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')
+ 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>
+ 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_PROJECT_DETAILS_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_PROJECT_DETAILS_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,13 +1,12 @@
 <?xml version="1.0"?>
   <database name="VIEW C_PROJECT_DETAILS_V">
     <view name="C_PROJECT_DETAILS_V"><![CDATA[SELECT pl.ad_client_id, pl.ad_org_id, pl.isactive, pl.created, pl.createdby, pl.updated, pl.updatedby, to_char('en_US') AS ad_language, pj.c_project_id, pl.c_projectline_id, pl.line, pl.plannedqty, pl.plannedprice, pl.plannedamt, pl.plannedmarginamt, pl.committedamt, pl.m_product_id, COALESCE(p.name, pl.description) AS name, 
-CASE
-WHEN p.name IS NOT NULL THEN pl.description
-ELSE NULL
-END AS description, p.documentnote, p.upc, p.sku, p.value AS productvalue, pl.m_product_category_id, pl.invoicedamt, pl.invoicedqty, pl.committedqty
-FROM c_projectline pl
-JOIN c_project pj ON pl.c_project_id = pj.c_project_id
-LEFT JOIN m_product p ON pl.m_product_id = p.m_product_id
-WHERE pl.isprinted = 'Y'
-]]></view>
+        CASE
+            WHEN p.name IS NOT NULL THEN pl.description
+            ELSE NULL
+        END AS description, p.documentnote, p.upc, p.sku, p.value AS productvalue, pl.m_product_category_id, pl.invoicedamt, pl.invoicedqty, pl.committedqty
+   FROM c_projectline pl
+   JOIN c_project pj ON pl.c_project_id = pj.c_project_id
+   LEFT JOIN m_product p ON pl.m_product_id = p.m_product_id
+  WHERE pl.isprinted = 'Y']]></view>
   </database>
--- a/src-db/database/model/views/C_PROJECT_DETAILS_VT.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_PROJECT_DETAILS_VT.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,13 +1,12 @@
 <?xml version="1.0"?>
   <database name="VIEW C_PROJECT_DETAILS_VT">
     <view name="C_PROJECT_DETAILS_VT"><![CDATA[SELECT pl.ad_client_id, pl.ad_org_id, pl.isactive, pl.created, pl.createdby, pl.updated, pl.updatedby, to_char('en_US') AS ad_language, pj.c_project_id, pl.c_projectline_id, pl.line, pl.plannedqty, pl.plannedprice, pl.plannedamt, pl.plannedmarginamt, pl.committedamt, pl.m_product_id, COALESCE(p.name, pl.description) AS name, 
-CASE
-WHEN p.name IS NOT NULL THEN pl.description
-ELSE NULL
-END AS description, p.documentnote, p.upc, p.sku, p.value AS productvalue, pl.m_product_category_id, pl.invoicedamt, pl.invoicedqty, pl.committedqty
-FROM c_projectline pl
-JOIN c_project pj ON pl.c_project_id = pj.c_project_id
-LEFT JOIN m_product p ON pl.m_product_id = p.m_product_id
-WHERE pl.isprinted = 'Y'
-]]></view>
+        CASE
+            WHEN p.name IS NOT NULL THEN pl.description
+            ELSE NULL
+        END AS description, p.documentnote, p.upc, p.sku, p.value AS productvalue, pl.m_product_category_id, pl.invoicedamt, pl.invoicedqty, pl.committedqty
+   FROM c_projectline pl
+   JOIN c_project pj ON pl.c_project_id = pj.c_project_id
+   LEFT JOIN m_product p ON pl.m_product_id = p.m_product_id
+  WHERE pl.isprinted = 'Y']]></view>
   </database>
--- a/src-db/database/model/views/C_PROJECT_HEADER_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_PROJECT_HEADER_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,17 +1,16 @@
 <?xml version="1.0"?>
   <database name="VIEW C_PROJECT_HEADER_V">
     <view name="C_PROJECT_HEADER_V"><![CDATA[SELECT p.ad_client_id, p.ad_org_id, p.isactive, p.created, p.createdby, p.updated, p.updatedby, to_char('en_US') AS ad_language, p.c_project_id, p.value, p.name AS projectname, p.description, p.note, p.issummary, p.projectcategory, oi.c_location_id AS org_location_id, oi.taxid, p.c_projecttype_id, pjt.name AS projecttypename, p.c_phase_id, pjp.name AS projectphasename, p.salesrep_id, COALESCE(ubp.name, u.name) AS salesrep_name, p.c_bpartner_id, bp.value AS bpvalue, bpg.name AS bpgreeting, bp.name, bp.name2, bpcg.name AS bpcontactgreeting, bpc.title, NULLIF(bpc.name, bp.name) AS contactname, bpl.c_location_id, bp.referenceno, pt.name AS paymentterm, pt.documentnote AS paymenttermnote, p.poreference, p.c_currency_id, p.m_pricelist_version_id, p.c_campaign_id, p.plannedamt, p.plannedqty, p.plannedmarginamt, p.invoicedamt, p.invoicedqty, p.projectbalanceamt, p.iscommitment, p.committedamt, p.committedqty, p.datecontract, p.datefinish, p.iscommitceiling, p.m_warehouse_id
-FROM c_project p
-LEFT JOIN c_bpartner bp ON p.c_bpartner_id = bp.c_bpartner_id
-JOIN ad_orginfo oi ON p.ad_org_id = oi.ad_org_id
-LEFT JOIN c_projecttype pjt ON p.c_projecttype_id = pjt.c_projecttype_id
-LEFT JOIN c_phase pjp ON p.c_phase_id = pjp.c_phase_id
-LEFT JOIN ad_user u ON p.salesrep_id = u.ad_user_id
-LEFT JOIN c_bpartner ubp ON u.c_bpartner_id = ubp.c_bpartner_id
-LEFT JOIN c_greeting bpg ON bp.c_greeting_id = bpg.c_greeting_id
-LEFT JOIN ad_user bpc ON p.ad_user_id = bpc.ad_user_id
-LEFT JOIN c_greeting bpcg ON bpc.c_greeting_id = bpcg.c_greeting_id
-LEFT JOIN c_bpartner_location bpl ON p.c_bpartner_location_id = bpl.c_bpartner_location_id
-LEFT JOIN c_paymentterm pt ON p.c_paymentterm_id = pt.c_paymentterm_id
-]]></view>
+   FROM c_project p
+   LEFT JOIN c_bpartner bp ON p.c_bpartner_id = bp.c_bpartner_id
+   JOIN ad_orginfo oi ON p.ad_org_id = oi.ad_org_id
+   LEFT JOIN c_projecttype pjt ON p.c_projecttype_id = pjt.c_projecttype_id
+   LEFT JOIN c_phase pjp ON p.c_phase_id = pjp.c_phase_id
+   LEFT JOIN ad_user u ON p.salesrep_id = u.ad_user_id
+   LEFT JOIN c_bpartner ubp ON u.c_bpartner_id = ubp.c_bpartner_id
+   LEFT JOIN c_greeting bpg ON bp.c_greeting_id = bpg.c_greeting_id
+   LEFT JOIN ad_user bpc ON p.ad_user_id = bpc.ad_user_id
+   LEFT JOIN c_greeting bpcg ON bpc.c_greeting_id = bpcg.c_greeting_id
+   LEFT JOIN c_bpartner_location bpl ON p.c_bpartner_location_id = bpl.c_bpartner_location_id
+   LEFT JOIN c_paymentterm pt ON p.c_paymentterm_id = pt.c_paymentterm_id]]></view>
   </database>
--- a/src-db/database/model/views/C_PROJECT_HEADER_VT.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/C_PROJECT_HEADER_VT.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,17 +1,16 @@
 <?xml version="1.0"?>
   <database name="VIEW C_PROJECT_HEADER_VT">
     <view name="C_PROJECT_HEADER_VT"><![CDATA[SELECT p.ad_client_id, p.ad_org_id, p.isactive, p.created, p.createdby, p.updated, p.updatedby, pt.ad_language, p.c_project_id, p.value, p.name AS projectname, p.description, p.note, p.issummary, p.projectcategory, oi.c_location_id AS org_location_id, oi.taxid, p.c_projecttype_id, pjt.name AS projecttypename, p.c_phase_id, pjp.name AS projectphasename, p.salesrep_id, COALESCE(ubp.name, u.name) AS salesrep_name, p.c_bpartner_id, bp.value AS bpvalue, bpg.name AS bpgreeting, bp.name, bp.name2, bpcg.name AS bpcontactgreeting, bpc.title, NULLIF(bpc.name, bp.name) AS contactname, bpl.c_location_id, bp.referenceno, pt.name AS paymentterm, pt.documentnote AS paymenttermnote, p.poreference, p.c_currency_id, p.m_pricelist_version_id, p.c_campaign_id, p.plannedamt, p.plannedqty, p.plannedmarginamt, p.invoicedamt, p.invoicedqty, p.projectbalanceamt, p.iscommitment, p.committedamt, p.committedqty, p.datecontract, p.datefinish, p.iscommitceiling, p.m_warehouse_id
-FROM c_project p
-LEFT JOIN c_bpartner bp ON p.c_bpartner_id = bp.c_bpartner_id
-JOIN ad_orginfo oi ON p.ad_org_id = oi.ad_org_id
-LEFT JOIN c_paymentterm_trl pt ON p.c_paymentterm_id = pt.c_paymentterm_id
-LEFT JOIN c_projecttype pjt ON p.c_projecttype_id = pjt.c_projecttype_id
-LEFT JOIN c_phase pjp ON p.c_phase_id = pjp.c_phase_id
-LEFT JOIN ad_user u ON p.salesrep_id = u.ad_user_id
-LEFT JOIN c_bpartner ubp ON u.c_bpartner_id = ubp.c_bpartner_id
-LEFT JOIN c_greeting bpg ON bp.c_greeting_id = bpg.c_greeting_id
-LEFT JOIN ad_user bpc ON p.ad_user_id = bpc.ad_user_id
-LEFT JOIN c_greeting bpcg ON bpc.c_greeting_id = bpcg.c_greeting_id
-LEFT JOIN c_bpartner_location bpl ON p.c_bpartner_location_id = bpl.c_bpartner_location_id
-]]></view>
+   FROM c_project p
+   LEFT JOIN c_bpartner bp ON p.c_bpartner_id = bp.c_bpartner_id
+   JOIN ad_orginfo oi ON p.ad_org_id = oi.ad_org_id
+   LEFT JOIN c_paymentterm_trl pt ON p.c_paymentterm_id = pt.c_paymentterm_id
+   LEFT JOIN c_projecttype pjt ON p.c_projecttype_id = pjt.c_projecttype_id
+   LEFT JOIN c_phase pjp ON p.c_phase_id = pjp.c_phase_id
+   LEFT JOIN ad_user u ON p.salesrep_id = u.ad_user_id
+   LEFT JOIN c_bpartner ubp ON u.c_bpartner_id = ubp.c_bpartner_id
+   LEFT JOIN c_greeting bpg ON bp.c_greeting_id = bpg.c_greeting_id
+   LEFT JOIN ad_user bpc ON p.ad_user_id = bpc.ad_user_id
+   LEFT JOIN c_greeting bpcg ON bpc.c_greeting_id = bpcg.c_greeting_id
+   LEFT JOIN c_bpartner_location bpl ON p.c_bpartner_location_id = bpl.c_bpartner_location_id]]></view>
   </database>
--- a/src-db/database/model/views/GL_JOURNALLINE_ACCT_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/GL_JOURNALLINE_ACCT_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,7 +1,6 @@
 <?xml version="1.0"?>
   <database name="VIEW GL_JOURNALLINE_ACCT_V">
     <view name="GL_JOURNALLINE_ACCT_V"><![CDATA[SELECT gl.gl_journalline_id, gl.ad_client_id, gl.ad_org_id, gl.isactive, gl.created, gl.createdby, gl.updated, gl.updatedby, gl.gl_journal_id, gl.line, gl.isgenerated, gl.description, gl.amtsourcedr, gl.amtsourcecr, gl.c_currency_id, gl.currencyratetype, gl.currencyrate, gl.dateacct, gl.amtacctdr, gl.amtacctcr, gl.c_uom_id, gl.qty, gl.c_validcombination_id, vc.c_acctschema_id, vc.account_id, vc.m_product_id, vc.c_bpartner_id, vc.ad_orgtrx_id, vc.c_locfrom_id, vc.c_locto_id, vc.c_salesregion_id, vc.c_project_id, vc.c_campaign_id, vc.user1_id, vc.user2_id, vc.isfullyqualified, vc.c_activity_id
-FROM gl_journalline gl, c_validcombination vc
-WHERE gl.c_validcombination_id = vc.c_validcombination_id
-]]></view>
+   FROM gl_journalline gl, c_validcombination vc
+  WHERE gl.c_validcombination_id = vc.c_validcombination_id]]></view>
   </database>
--- a/src-db/database/model/views/MA_PROCESSPLAN_TOTALIZED.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/MA_PROCESSPLAN_TOTALIZED.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,23 +1,22 @@
 <?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_version, ( SELECT ma_processplan_version.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_processplan_version, ma_sequence, ma_sequenceproduct
-WHERE ma_processplan_version.ma_processplan_version_id = ma_sequence.ma_processplan_version_id AND ma_sequence.ma_sequence_id = ma_sequenceproduct.ma_sequence_id
-GROUP BY ma_processplan_version.ma_processplan_version_id, ma_sequenceproduct.m_product_id) sp1, ( SELECT ma_processplan_version.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_processplan_version, ma_sequence, ma_sequenceproduct
-WHERE ma_processplan_version.ma_processplan_version_id = ma_sequence.ma_processplan_version_id AND ma_sequence.ma_sequence_id = ma_sequenceproduct.ma_sequence_id
-GROUP BY ma_processplan_version.ma_processplan_version_id, ma_sequenceproduct.m_product_id) sp2
-WHERE m_product.ma_processplan_id = ma_processplan_version.ma_processplan_id 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>
+   FROM m_product, ma_processplan_version, ( SELECT ma_processplan_version.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_processplan_version, ma_sequence, ma_sequenceproduct
+          WHERE ma_processplan_version.ma_processplan_version_id = ma_sequence.ma_processplan_version_id AND ma_sequence.ma_sequence_id = ma_sequenceproduct.ma_sequence_id
+          GROUP BY ma_processplan_version.ma_processplan_version_id, ma_sequenceproduct.m_product_id) sp1, ( SELECT ma_processplan_version.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_processplan_version, ma_sequence, ma_sequenceproduct
+          WHERE ma_processplan_version.ma_processplan_version_id = ma_sequence.ma_processplan_version_id AND ma_sequence.ma_sequence_id = ma_sequenceproduct.ma_sequence_id
+          GROUP BY ma_processplan_version.ma_processplan_version_id, ma_sequenceproduct.m_product_id) sp2
+  WHERE m_product.ma_processplan_id = ma_processplan_version.ma_processplan_id 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/MA_SEQUENCE_EMPLOYEE_COST.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/MA_SEQUENCE_EMPLOYEE_COST.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,18 +1,17 @@
 <?xml version="1.0"?>
   <database name="VIEW MA_SEQUENCE_EMPLOYEE_COST">
     <view name="MA_SEQUENCE_EMPLOYEE_COST"><![CDATA[SELECT ma_sequence.ma_sequence_id, c_salary_category_cost.c_salary_category_id, 
-CASE c_salary_category_cost.costuom
-WHEN 'H' THEN ma_sequence.costcenteruse * c_salary_category_cost.cost
-WHEN 'U' THEN sum(ma_sequenceproduct.quantity) * c_salary_category_cost.cost
-WHEN 'K' THEN sum(ma_sequenceproduct.quantity * m_product.weight) * c_salary_category_cost.cost
-ELSE NULL
-END AS cost
-FROM ma_sequence, ma_process, ma_processplan_version, ma_costcenter_version, ma_costcenter_employee, c_salary_category_cost, m_product, ma_sequenceproduct
-WHERE ma_sequence.ma_process_id = ma_process.ma_process_id AND ma_sequence.ma_processplan_version_id = ma_processplan_version.ma_processplan_version_id AND ma_process.ma_costcenter_id = ma_costcenter_version.ma_costcenter_id AND ma_costcenter_version.ma_costcenter_version_id = ma_costcenter_employee.ma_costcenter_version_id AND ma_costcenter_employee.c_salary_category_id = c_salary_category_cost.c_salary_category_id AND ma_sequence.ma_sequence_id = ma_sequenceproduct.ma_sequence_id AND ma_sequenceproduct.m_product_id = m_product.m_product_id AND ma_sequenceproduct.productiontype = '+' AND ma_costcenter_version.validfrom = (( SELECT max(ccv.validfrom) AS max
-FROM ma_costcenter_version ccv
-WHERE ccv.ma_costcenter_id = ma_costcenter_version.ma_costcenter_id AND ccv.validfrom <= ma_processplan_version.datefrom)) AND c_salary_category_cost.datefrom = (( SELECT max(sc.datefrom) AS max
-FROM c_salary_category_cost sc
-WHERE sc.c_salary_category_id = c_salary_category_cost.c_salary_category_id AND sc.datefrom <= ma_processplan_version.datefrom))
-GROUP BY ma_sequence.ma_sequence_id, c_salary_category_cost.c_salary_category_id, c_salary_category_cost.cost, c_salary_category_cost.costuom, ma_sequence.costcenteruse
-]]></view>
+        CASE c_salary_category_cost.costuom
+            WHEN 'H' THEN ma_sequence.costcenteruse * c_salary_category_cost.cost
+            WHEN 'U' THEN sum(ma_sequenceproduct.quantity) * c_salary_category_cost.cost
+            WHEN 'K' THEN sum(ma_sequenceproduct.quantity * m_product.weight) * c_salary_category_cost.cost
+            ELSE NULL
+        END AS cost
+   FROM ma_sequence, ma_process, ma_processplan_version, ma_costcenter_version, ma_costcenter_employee, c_salary_category_cost, m_product, ma_sequenceproduct
+  WHERE ma_sequence.ma_process_id = ma_process.ma_process_id AND ma_sequence.ma_processplan_version_id = ma_processplan_version.ma_processplan_version_id AND ma_process.ma_costcenter_id = ma_costcenter_version.ma_costcenter_id AND ma_costcenter_version.ma_costcenter_version_id = ma_costcenter_employee.ma_costcenter_version_id AND ma_costcenter_employee.c_salary_category_id = c_salary_category_cost.c_salary_category_id AND ma_sequence.ma_sequence_id = ma_sequenceproduct.ma_sequence_id AND ma_sequenceproduct.m_product_id = m_product.m_product_id AND ma_sequenceproduct.productiontype = '+' AND ma_costcenter_version.validfrom = (( SELECT max(ccv.validfrom) AS max
+           FROM ma_costcenter_version ccv
+          WHERE ccv.ma_costcenter_id = ma_costcenter_version.ma_costcenter_id AND ccv.validfrom <= ma_processplan_version.datefrom)) AND c_salary_category_cost.datefrom = (( SELECT max(sc.datefrom) AS max
+           FROM c_salary_category_cost sc
+          WHERE sc.c_salary_category_id = c_salary_category_cost.c_salary_category_id AND sc.datefrom <= ma_processplan_version.datefrom))
+  GROUP BY ma_sequence.ma_sequence_id, c_salary_category_cost.c_salary_category_id, c_salary_category_cost.cost, c_salary_category_cost.costuom, ma_sequence.costcenteruse]]></view>
   </database>
--- a/src-db/database/model/views/MA_SEQUENCE_INDIRECT_COST_COST.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/MA_SEQUENCE_INDIRECT_COST_COST.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,18 +1,17 @@
 <?xml version="1.0"?>
   <database name="VIEW MA_SEQUENCE_INDIRECT_COST_COST">
     <view name="MA_SEQUENCE_INDIRECT_COST_COST"><![CDATA[SELECT ma_sequence.ma_sequence_id, ma_indirect_cost_value.ma_indirect_cost_id, 
-CASE ma_indirect_cost_value.cost_uom
-WHEN 'H' THEN ma_sequence.costcenteruse * ma_indirect_cost_value.cost
-WHEN 'U' THEN sum(ma_sequenceproduct.quantity) * ma_indirect_cost_value.cost
-WHEN 'K' THEN sum(ma_sequenceproduct.quantity * m_product.weight) * ma_indirect_cost_value.cost
-ELSE NULL
-END AS cost
-FROM ma_sequence, ma_process, ma_processplan_version, ma_costcenter_version, ma_costcenter_ic, ma_indirect_cost_value, m_product, ma_sequenceproduct
-WHERE ma_sequence.ma_process_id = ma_process.ma_process_id AND ma_sequence.ma_processplan_version_id = ma_processplan_version.ma_processplan_version_id AND ma_process.ma_costcenter_id = ma_costcenter_version.ma_costcenter_id AND ma_costcenter_version.ma_costcenter_version_id = ma_costcenter_ic.ma_costcenter_version_id AND ma_costcenter_ic.ma_indirect_cost_id = ma_indirect_cost_value.ma_indirect_cost_id AND ma_sequence.ma_sequence_id = ma_sequenceproduct.ma_sequence_id AND ma_sequenceproduct.m_product_id = m_product.m_product_id AND ma_sequenceproduct.productiontype = '+' AND ma_indirect_cost_value.cost_uom <> 'P' AND ma_costcenter_version.validfrom = (( SELECT max(ccv.validfrom) AS max
-FROM ma_costcenter_version ccv
-WHERE ccv.ma_costcenter_id = ma_costcenter_version.ma_costcenter_id AND ccv.validfrom <= ma_processplan_version.datefrom)) AND ma_indirect_cost_value.datefrom = (( SELECT max(sc.datefrom) AS max
-FROM ma_indirect_cost_value sc
-WHERE sc.ma_indirect_cost_id = ma_indirect_cost_value.ma_indirect_cost_id AND sc.datefrom <= ma_processplan_version.datefrom))
-GROUP BY ma_sequence.ma_sequence_id, ma_indirect_cost_value.ma_indirect_cost_id, ma_indirect_cost_value.cost, ma_indirect_cost_value.cost_uom, ma_sequence.costcenteruse
-]]></view>
+        CASE ma_indirect_cost_value.cost_uom
+            WHEN 'H' THEN ma_sequence.costcenteruse * ma_indirect_cost_value.cost
+            WHEN 'U' THEN sum(ma_sequenceproduct.quantity) * ma_indirect_cost_value.cost
+            WHEN 'K' THEN sum(ma_sequenceproduct.quantity * m_product.weight) * ma_indirect_cost_value.cost
+            ELSE NULL
+        END AS cost
+   FROM ma_sequence, ma_process, ma_processplan_version, ma_costcenter_version, ma_costcenter_ic, ma_indirect_cost_value, m_product, ma_sequenceproduct
+  WHERE ma_sequence.ma_process_id = ma_process.ma_process_id AND ma_sequence.ma_processplan_version_id = ma_processplan_version.ma_processplan_version_id AND ma_process.ma_costcenter_id = ma_costcenter_version.ma_costcenter_id AND ma_costcenter_version.ma_costcenter_version_id = ma_costcenter_ic.ma_costcenter_version_id AND ma_costcenter_ic.ma_indirect_cost_id = ma_indirect_cost_value.ma_indirect_cost_id AND ma_sequence.ma_sequence_id = ma_sequenceproduct.ma_sequence_id AND ma_sequenceproduct.m_product_id = m_product.m_product_id AND ma_sequenceproduct.productiontype = '+' AND ma_indirect_cost_value.cost_uom <> 'P' AND ma_costcenter_version.validfrom = (( SELECT max(ccv.validfrom) AS max
+           FROM ma_costcenter_version ccv
+          WHERE ccv.ma_costcenter_id = ma_costcenter_version.ma_costcenter_id AND ccv.validfrom <= ma_processplan_version.datefrom)) AND ma_indirect_cost_value.datefrom = (( SELECT max(sc.datefrom) AS max
+           FROM ma_indirect_cost_value sc
+          WHERE sc.ma_indirect_cost_id = ma_indirect_cost_value.ma_indirect_cost_id AND sc.datefrom <= ma_processplan_version.datefrom))
+  GROUP BY ma_sequence.ma_sequence_id, ma_indirect_cost_value.ma_indirect_cost_id, ma_indirect_cost_value.cost, ma_indirect_cost_value.cost_uom, ma_sequence.costcenteruse]]></view>
   </database>
--- a/src-db/database/model/views/MA_SEQUENCE_MACHINE_COST.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/MA_SEQUENCE_MACHINE_COST.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,18 +1,17 @@
 <?xml version="1.0"?>
   <database name="VIEW MA_SEQUENCE_MACHINE_COST">
     <view name="MA_SEQUENCE_MACHINE_COST"><![CDATA[SELECT ma_sequence.ma_sequence_id, ma_machine_cost.ma_machine_id, 
-CASE ma_machine_cost.costuom
-WHEN 'H' THEN ma_sequence.costcenteruse * ma_machine_cost.cost
-WHEN 'U' THEN sum(ma_sequenceproduct.quantity) * ma_machine_cost.cost
-WHEN 'K' THEN sum(ma_sequenceproduct.quantity * m_product.weight) * ma_machine_cost.cost
-ELSE NULL
-END AS cost
-FROM ma_sequence, ma_process, ma_processplan_version, ma_costcenter_version, ma_costcenter_machine, ma_machine_cost, m_product, ma_sequenceproduct
-WHERE ma_sequence.ma_process_id = ma_process.ma_process_id AND ma_sequence.ma_processplan_version_id = ma_processplan_version.ma_processplan_version_id AND ma_process.ma_costcenter_id = ma_costcenter_version.ma_costcenter_id AND ma_costcenter_version.ma_costcenter_version_id = ma_costcenter_machine.ma_costcenter_version_id AND ma_costcenter_machine.ma_machine_id = ma_machine_cost.ma_machine_id AND ma_sequence.ma_sequence_id = ma_sequenceproduct.ma_sequence_id AND ma_sequenceproduct.m_product_id = m_product.m_product_id AND ma_sequenceproduct.productiontype = '+' AND ma_costcenter_version.validfrom = (( SELECT max(ccv.validfrom) AS max
-FROM ma_costcenter_version ccv
-WHERE ccv.ma_costcenter_id = ma_costcenter_version.ma_costcenter_id AND ccv.validfrom <= ma_processplan_version.datefrom)) AND ma_machine_cost.validfrom = (( SELECT max(mc.validfrom) AS max
-FROM ma_machine_cost mc
-WHERE mc.ma_machine_id = ma_machine_cost.ma_machine_id AND mc.validfrom <= ma_processplan_version.datefrom))
-GROUP BY ma_sequence.ma_sequence_id, ma_machine_cost.ma_machine_id, ma_machine_cost.cost, ma_machine_cost.costuom, ma_sequence.costcenteruse
-]]></view>
+        CASE ma_machine_cost.costuom
+            WHEN 'H' THEN ma_sequence.costcenteruse * ma_machine_cost.cost
+            WHEN 'U' THEN sum(ma_sequenceproduct.quantity) * ma_machine_cost.cost
+            WHEN 'K' THEN sum(ma_sequenceproduct.quantity * m_product.weight) * ma_machine_cost.cost
+            ELSE NULL
+        END AS cost
+   FROM ma_sequence, ma_process, ma_processplan_version, ma_costcenter_version, ma_costcenter_machine, ma_machine_cost, m_product, ma_sequenceproduct
+  WHERE ma_sequence.ma_process_id = ma_process.ma_process_id AND ma_sequence.ma_processplan_version_id = ma_processplan_version.ma_processplan_version_id AND ma_process.ma_costcenter_id = ma_costcenter_version.ma_costcenter_id AND ma_costcenter_version.ma_costcenter_version_id = ma_costcenter_machine.ma_costcenter_version_id AND ma_costcenter_machine.ma_machine_id = ma_machine_cost.ma_machine_id AND ma_sequence.ma_sequence_id = ma_sequenceproduct.ma_sequence_id AND ma_sequenceproduct.m_product_id = m_product.m_product_id AND ma_sequenceproduct.productiontype = '+' AND ma_costcenter_version.validfrom = (( SELECT max(ccv.validfrom) AS max
+           FROM ma_costcenter_version ccv
+          WHERE ccv.ma_costcenter_id = ma_costcenter_version.ma_costcenter_id AND ccv.validfrom <= ma_processplan_version.datefrom)) AND ma_machine_cost.validfrom = (( SELECT max(mc.validfrom) AS max
+           FROM ma_machine_cost mc
+          WHERE mc.ma_machine_id = ma_machine_cost.ma_machine_id AND mc.validfrom <= ma_processplan_version.datefrom))
+  GROUP BY ma_sequence.ma_sequence_id, ma_machine_cost.ma_machine_id, ma_machine_cost.cost, ma_machine_cost.costuom, ma_sequence.costcenteruse]]></view>
   </database>
--- a/src-db/database/model/views/M_INOUT_CANDIDATE_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/M_INOUT_CANDIDATE_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,11 +1,10 @@
 <?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>
+   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_INOUT_HEADER_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/M_INOUT_HEADER_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,14 +1,13 @@
 <?xml version="1.0"?>
   <database name="VIEW M_INOUT_HEADER_V">
     <view name="M_INOUT_HEADER_V"><![CDATA[SELECT io.ad_client_id, io.ad_org_id, io.isactive, io.created, io.createdby, io.updated, io.updatedby, to_char('en_US') AS ad_language, io.m_inout_id, io.issotrx, io.documentno, io.docstatus, io.c_doctype_id, io.c_bpartner_id, bp.value AS bpvalue, oi.c_location_id AS org_location_id, oi.taxid, io.m_warehouse_id, wh.c_location_id AS warehouse_location_id, dt.printname AS documenttype, dt.documentnote AS documenttypenote, io.c_order_id, io.movementdate, io.movementtype, bpg.name AS bpgreeting, bp.name, bp.name2, bpcg.name AS bpcontactgreeting, bpc.title, NULLIF(bpc.name, bp.name) AS contactname, bpl.c_location_id, bp.referenceno, io.description, io.poreference, io.dateordered, io.m_shipper_id, io.deliveryrule, io.deliveryviarule, io.priorityrule
-FROM m_inout io
-JOIN c_doctype dt ON io.c_doctype_id = dt.c_doctype_id
-JOIN c_bpartner bp ON io.c_bpartner_id = bp.c_bpartner_id
-LEFT JOIN c_greeting bpg ON bp.c_greeting_id = bpg.c_greeting_id
-JOIN c_bpartner_location bpl ON io.c_bpartner_location_id = bpl.c_bpartner_location_id
-LEFT JOIN ad_user bpc ON io.ad_user_id = bpc.ad_user_id
-LEFT JOIN c_greeting bpcg ON bpc.c_greeting_id = bpcg.c_greeting_id
-JOIN ad_orginfo oi ON io.ad_org_id = oi.ad_org_id
-JOIN m_warehouse wh ON io.m_warehouse_id = wh.m_warehouse_id
-]]></view>
+   FROM m_inout io
+   JOIN c_doctype dt ON io.c_doctype_id = dt.c_doctype_id
+   JOIN c_bpartner bp ON io.c_bpartner_id = bp.c_bpartner_id
+   LEFT JOIN c_greeting bpg ON bp.c_greeting_id = bpg.c_greeting_id
+   JOIN c_bpartner_location bpl ON io.c_bpartner_location_id = bpl.c_bpartner_location_id
+   LEFT JOIN ad_user bpc ON io.ad_user_id = bpc.ad_user_id
+   LEFT JOIN c_greeting bpcg ON bpc.c_greeting_id = bpcg.c_greeting_id
+   JOIN ad_orginfo oi ON io.ad_org_id = oi.ad_org_id
+   JOIN m_warehouse wh ON io.m_warehouse_id = wh.m_warehouse_id]]></view>
   </database>
--- a/src-db/database/model/views/M_INOUT_HEADER_VT.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/M_INOUT_HEADER_VT.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,14 +1,13 @@
 <?xml version="1.0"?>
   <database name="VIEW M_INOUT_HEADER_VT">
     <view name="M_INOUT_HEADER_VT"><![CDATA[SELECT io.ad_client_id, io.ad_org_id, io.isactive, io.created, io.createdby, io.updated, io.updatedby, dt.ad_language, io.m_inout_id, io.issotrx, io.documentno, io.docstatus, io.c_doctype_id, io.c_bpartner_id, bp.value AS bpvalue, oi.c_location_id AS org_location_id, oi.taxid, io.m_warehouse_id, wh.c_location_id AS warehouse_location_id, dt.printname AS documenttype, dt.documentnote AS documenttypenote, io.c_order_id, io.movementdate, io.movementtype, bpg.name AS bpgreeting, bp.name, bp.name2, bpcg.name AS bpcontactgreeting, bpc.title, NULLIF(bpc.name, bp.name) AS contactname, bpl.c_location_id, bp.referenceno, io.description, io.poreference, io.dateordered, io.m_shipper_id, io.deliveryrule, io.deliveryviarule, io.priorityrule
-FROM m_inout io
-JOIN c_doctype_trl dt ON io.c_doctype_id = dt.c_doctype_id
-JOIN c_bpartner bp ON io.c_bpartner_id = bp.c_bpartner_id
-LEFT JOIN c_greeting_trl bpg ON bp.c_greeting_id = bpg.c_greeting_id AND dt.ad_language = bpg.ad_language
-JOIN c_bpartner_location bpl ON io.c_bpartner_location_id = bpl.c_bpartner_location_id
-LEFT JOIN ad_user bpc ON io.ad_user_id = bpc.ad_user_id
-LEFT JOIN c_greeting_trl bpcg ON bpc.c_greeting_id = bpcg.c_greeting_id AND dt.ad_language = bpcg.ad_language
-JOIN ad_orginfo oi ON io.ad_org_id = oi.ad_org_id
-JOIN m_warehouse wh ON io.m_warehouse_id = wh.m_warehouse_id
-]]></view>
+   FROM m_inout io
+   JOIN c_doctype_trl dt ON io.c_doctype_id = dt.c_doctype_id
+   JOIN c_bpartner bp ON io.c_bpartner_id = bp.c_bpartner_id
+   LEFT JOIN c_greeting_trl bpg ON bp.c_greeting_id = bpg.c_greeting_id AND dt.ad_language = bpg.ad_language
+   JOIN c_bpartner_location bpl ON io.c_bpartner_location_id = bpl.c_bpartner_location_id
+   LEFT JOIN ad_user bpc ON io.ad_user_id = bpc.ad_user_id
+   LEFT JOIN c_greeting_trl bpcg ON bpc.c_greeting_id = bpcg.c_greeting_id AND dt.ad_language = bpcg.ad_language
+   JOIN ad_orginfo oi ON io.ad_org_id = oi.ad_org_id
+   JOIN m_warehouse wh ON io.m_warehouse_id = wh.m_warehouse_id]]></view>
   </database>
--- a/src-db/database/model/views/M_INOUT_LINE_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/M_INOUT_LINE_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,19 +1,18 @@
 <?xml version="1.0"?>
   <database name="VIEW M_INOUT_LINE_V">
     <view name="M_INOUT_LINE_V"><![CDATA[SELECT iol.ad_client_id, iol.ad_org_id, iol.isactive, iol.created, iol.createdby, iol.updated, iol.updatedby, 'en_US' AS ad_language, iol.m_inout_id, iol.m_inoutline_id, iol.line, iol.movementqty, uom.uomsymbol, COALESCE(p.name, iol.description) AS name, 
-CASE
-WHEN p.name IS NOT NULL THEN iol.description
-ELSE NULL
-END AS description, p.documentnote, p.upc, p.sku, p.value AS productvalue, iol.m_locator_id, iol.lot, iol.serno
-FROM m_inoutline iol
-JOIN c_uom uom ON iol.c_uom_id = uom.c_uom_id
-LEFT JOIN m_product p ON iol.m_product_id = p.m_product_id
+        CASE
+            WHEN p.name IS NOT NULL THEN iol.description
+            ELSE NULL
+        END AS description, p.documentnote, p.upc, p.sku, p.value AS productvalue, iol.m_locator_id, iol.lot, iol.serno
+   FROM m_inoutline iol
+   JOIN c_uom uom ON iol.c_uom_id = uom.c_uom_id
+   LEFT JOIN m_product p ON iol.m_product_id = p.m_product_id
 UNION 
-SELECT iol.ad_client_id, iol.ad_org_id, iol.isactive, iol.created, iol.createdby, iol.updated, iol.updatedby, 'en_US' AS ad_language, iol.m_inout_id, iol.m_inoutline_id, iol.line + b.line / 100 AS line, iol.movementqty * b.bomqty AS movementqty, uom.uomsymbol, p.name, b.description, p.documentnote, p.upc, p.sku, p.value AS productvalue, iol.m_locator_id, iol.lot, iol.serno
-FROM m_product_bom b
-JOIN m_inoutline iol ON b.m_product_id = iol.m_product_id
-JOIN m_product bp ON bp.m_product_id = iol.m_product_id AND bp.isbom = 'Y' AND bp.isverified = 'Y' AND bp.ispicklistprintdetails = 'Y'
-JOIN m_product p ON b.m_productbom_id = p.m_product_id
-JOIN c_uom uom ON p.c_uom_id = uom.c_uom_id
-]]></view>
+ SELECT iol.ad_client_id, iol.ad_org_id, iol.isactive, iol.created, iol.createdby, iol.updated, iol.updatedby, 'en_US' AS ad_language, iol.m_inout_id, iol.m_inoutline_id, iol.line + b.line / 100 AS line, iol.movementqty * b.bomqty AS movementqty, uom.uomsymbol, p.name, b.description, p.documentnote, p.upc, p.sku, p.value AS productvalue, iol.m_locator_id, iol.lot, iol.serno
+   FROM m_product_bom b
+   JOIN m_inoutline iol ON b.m_product_id = iol.m_product_id
+   JOIN m_product bp ON bp.m_product_id = iol.m_product_id AND bp.isbom = 'Y' AND bp.isverified = 'Y' AND bp.ispicklistprintdetails = 'Y'
+   JOIN m_product p ON b.m_productbom_id = p.m_product_id
+   JOIN c_uom uom ON p.c_uom_id = uom.c_uom_id]]></view>
   </database>
--- a/src-db/database/model/views/M_INOUT_LINE_VT.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/M_INOUT_LINE_VT.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,21 +1,20 @@
 <?xml version="1.0"?>
   <database name="VIEW M_INOUT_LINE_VT">
     <view name="M_INOUT_LINE_VT"><![CDATA[SELECT iol.ad_client_id, iol.ad_org_id, iol.isactive, iol.created, iol.createdby, iol.updated, iol.updatedby, uom.ad_language, iol.m_inout_id, iol.m_inoutline_id, iol.line, iol.movementqty, uom.uomsymbol, COALESCE(COALESCE(pt.name, p.name), iol.description) AS name, 
-CASE
-WHEN COALESCE(pt.name, p.name) IS NOT NULL THEN iol.description
-ELSE NULL
-END AS description, COALESCE(pt.documentnote, p.documentnote) AS documentnote, p.upc, p.sku, p.value AS productvalue, iol.m_locator_id, iol.lot, iol.serno
-FROM m_inoutline iol
-JOIN c_uom_trl uom ON iol.c_uom_id = uom.c_uom_id
-LEFT JOIN m_product p ON iol.m_product_id = p.m_product_id
-LEFT JOIN m_product_trl pt ON iol.m_product_id = pt.m_product_id AND uom.ad_language = pt.ad_language
+        CASE
+            WHEN COALESCE(pt.name, p.name) IS NOT NULL THEN iol.description
+            ELSE NULL
+        END AS description, COALESCE(pt.documentnote, p.documentnote) AS documentnote, p.upc, p.sku, p.value AS productvalue, iol.m_locator_id, iol.lot, iol.serno
+   FROM m_inoutline iol
+   JOIN c_uom_trl uom ON iol.c_uom_id = uom.c_uom_id
+   LEFT JOIN m_product p ON iol.m_product_id = p.m_product_id
+   LEFT JOIN m_product_trl pt ON iol.m_product_id = pt.m_product_id AND uom.ad_language = pt.ad_language
 UNION 
-SELECT iol.ad_client_id, iol.ad_org_id, iol.isactive, iol.created, iol.createdby, iol.updated, iol.updatedby, uom.ad_language, iol.m_inout_id, iol.m_inoutline_id, iol.line + b.line / 100 AS line, iol.movementqty * b.bomqty AS movementqty, 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, iol.m_locator_id, iol.lot, iol.serno
-FROM m_product_bom b
-JOIN m_inoutline iol ON b.m_product_id = iol.m_product_id
-JOIN m_product bp ON bp.m_product_id = iol.m_product_id AND bp.isbom = 'Y' AND bp.isverified = 'Y' AND bp.ispicklistprintdetails = '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 iol.m_product_id = pt.m_product_id AND uom.ad_language = pt.ad_language
-]]></view>
+ SELECT iol.ad_client_id, iol.ad_org_id, iol.isactive, iol.created, iol.createdby, iol.updated, iol.updatedby, uom.ad_language, iol.m_inout_id, iol.m_inoutline_id, iol.line + b.line / 100 AS line, iol.movementqty * b.bomqty AS movementqty, 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, iol.m_locator_id, iol.lot, iol.serno
+   FROM m_product_bom b
+   JOIN m_inoutline iol ON b.m_product_id = iol.m_product_id
+   JOIN m_product bp ON bp.m_product_id = iol.m_product_id AND bp.isbom = 'Y' AND bp.isverified = 'Y' AND bp.ispicklistprintdetails = '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 iol.m_product_id = pt.m_product_id AND uom.ad_language = pt.ad_language]]></view>
   </database>
--- a/src-db/database/model/views/REPORT_PROJECTPROPOSAL.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/REPORT_PROJECTPROPOSAL.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,7 +1,6 @@
 <?xml version="1.0"?>
   <database name="VIEW REPORT_PROJECTPROPOSAL">
     <view name="REPORT_PROJECTPROPOSAL"><![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
-WHERE p.ad_user_id = u.ad_user_id AND p.isactive = 'Y'
-]]></view>
+   FROM c_projectproposal p, ad_user u
+  WHERE p.ad_user_id = u.ad_user_id AND p.isactive = 'Y']]></view>
   </database>
--- a/src-db/database/model/views/RV_ASSET_CUSTOMER.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_ASSET_CUSTOMER.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,9 +1,8 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_ASSET_CUSTOMER">
     <view name="RV_ASSET_CUSTOMER"><![CDATA[SELECT a.a_asset_id, a.ad_client_id, a.ad_org_id, a.isactive, a.created, a.createdby, a.updated, a.updatedby, a.value, a.name, a.description, a.help, a.a_asset_group_id, a.m_product_id, a.serno, a.lot, a.versionno, a.guaranteedate, a.assetservicedate, a.c_bpartner_id, a.c_bpartner_location_id, a.ad_user_id, ( SELECT count(*) AS count
-FROM a_asset_delivery ad
-WHERE a.a_asset_id = ad.a_asset_id) AS deliverycount
-FROM a_asset a
-WHERE a.c_bpartner_id IS NOT NULL
-]]></view>
+           FROM a_asset_delivery ad
+          WHERE a.a_asset_id = ad.a_asset_id) AS deliverycount
+   FROM a_asset a
+  WHERE a.c_bpartner_id IS NOT NULL]]></view>
   </database>
--- a/src-db/database/model/views/RV_ASSET_DELIVERY.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_ASSET_DELIVERY.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,7 +1,6 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_ASSET_DELIVERY">
     <view name="RV_ASSET_DELIVERY"><![CDATA[SELECT ad.a_asset_delivery_id, ad.ad_client_id, ad.ad_org_id, ad.isactive, ad.created, ad.createdby, ad.updated, ad.updatedby, a.a_asset_id, a.a_asset_group_id, a.m_product_id, a.guaranteedate, a.assetservicedate, a.c_bpartner_id, ad.ad_user_id, ad.movementdate, ad.serno, ad.lot, ad.versionno, ad.m_inoutline_id, ad.email, ad.messageid, ad.deliveryconfirmation, ad.url, ad.remote_addr, ad.remote_host, ad.referrer, ad.description
-FROM a_asset_delivery ad
-JOIN a_asset a ON a.a_asset_id = ad.a_asset_id
-]]></view>
+   FROM a_asset_delivery ad
+   JOIN a_asset a ON a.a_asset_id = ad.a_asset_id]]></view>
   </database>
--- a/src-db/database/model/views/RV_BPARTNER.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_BPARTNER.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,9 +1,8 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_BPARTNER">
     <view name="RV_BPARTNER"><![CDATA[SELECT p.ad_client_id, p.ad_org_id, p.c_bpartner_id, p.value, p.name, p.referenceno, p.so_creditlimit - p.so_creditused AS so_creditavailable, p.so_creditlimit, p.so_creditused, p.iscustomer, p.isvendor, p.actuallifetimevalue AS revenue, c.name AS contact, c.phone, a.postal, a.city, c.email
-FROM c_bpartner p
-LEFT JOIN ad_user c ON p.c_bpartner_id = c.c_bpartner_id
-LEFT JOIN c_bpartner_location l ON p.c_bpartner_id = l.c_bpartner_id
-LEFT JOIN c_location a ON l.c_location_id = a.c_location_id
-]]></view>
+   FROM c_bpartner p
+   LEFT JOIN ad_user c ON p.c_bpartner_id = c.c_bpartner_id
+   LEFT JOIN c_bpartner_location l ON p.c_bpartner_id = l.c_bpartner_id
+   LEFT JOIN c_location a ON l.c_location_id = a.c_location_id]]></view>
   </database>
--- a/src-db/database/model/views/RV_CASH_DETAIL.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_CASH_DETAIL.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,7 +1,6 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_CASH_DETAIL">
     <view name="RV_CASH_DETAIL"><![CDATA[SELECT cl.c_cash_id, cl.c_cashline_id, c.ad_client_id, c.ad_org_id, cl.isactive, cl.created, cl.createdby, cl.updated, cl.updatedby, c.c_cashbook_id, c.name, c.statementdate, c.dateacct, c.processed, c.posted, cl.line, cl.description, cl.cashtype, cl.c_currency_id, cl.amount, c_currency_convert(cl.amount, cl.c_currency_id, cb.c_currency_id, c.statementdate, NULL, c.ad_client_id, c.ad_org_id) AS convertedamt, cl.c_debt_payment_id, cl.c_charge_id
-FROM c_cash c, c_cashline cl, c_cashbook cb
-WHERE c.c_cash_id = cl.c_cash_id AND c.c_cashbook_id = cb.c_cashbook_id
-]]></view>
+   FROM c_cash c, c_cashline cl, c_cashbook cb
+  WHERE c.c_cash_id = cl.c_cash_id AND c.c_cashbook_id = cb.c_cashbook_id]]></view>
   </database>
--- a/src-db/database/model/views/RV_C_INVOICE.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_C_INVOICE.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,23 +1,22 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_C_INVOICE">
     <view name="RV_C_INVOICE"><![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.isprinted, i.isdiscountprinted, i.processing, i.processed, i.istransferred, i.ispaid, i.c_doctype_id, i.c_doctypetarget_id, i.c_order_id, i.description, i.isapproved, 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>
+        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/RV_C_INVOICELINE.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_C_INVOICELINE.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,23 +1,22 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_C_INVOICELINE">
     <view name="RV_C_INVOICELINE"><![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, 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
-FROM rv_c_invoice i, c_invoiceline il, m_product p
-WHERE i.c_invoice_id = il.c_invoice_id AND il.m_product_id = p.m_product_id
-]]></view>
+        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
+   FROM rv_c_invoice i, c_invoiceline il, m_product p
+  WHERE i.c_invoice_id = il.c_invoice_id AND il.m_product_id = p.m_product_id]]></view>
   </database>
--- a/src-db/database/model/views/RV_C_INVOICE_CUSTOMERPRODQTR.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_C_INVOICE_CUSTOMERPRODQTR.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,15 +1,14 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_C_INVOICE_CUSTOMERPRODQTR">
     <view name="RV_C_INVOICE_CUSTOMERPRODQTR"><![CDATA[SELECT il.ad_client_id, il.ad_org_id, il.c_bpartner_id, il.m_product_category_id, TRUNC(il.dateinvoiced, 'Q') AS dateinvoiced, sum(il.linenetamt) AS linenetamt, sum(il.linelistamt) AS linelistamt, sum(il.linelimitamt) AS linelimitamt, sum(il.linediscountamt) AS linediscountamt, 
-CASE sum(il.linelistamt)
-WHEN 0 THEN 0
-ELSE round((sum(il.linelistamt) - sum(il.linenetamt)) / sum(il.linelistamt) * 100, 2)
-END AS linediscount, sum(il.lineoverlimitamt) AS lineoverlimitamt, 
-CASE sum(il.linenetamt)
-WHEN 0 THEN 0
-ELSE 100 - round((sum(il.linenetamt) - sum(il.lineoverlimitamt)) / sum(il.linenetamt) * 100, 2)
-END AS lineoverlimit, sum(il.qtyinvoiced) AS qtyinvoiced
-FROM rv_c_invoiceline il
-GROUP BY il.ad_client_id, il.ad_org_id, il.c_bpartner_id, il.m_product_category_id, TRUNC(il.dateinvoiced, 'Q')
-]]></view>
+        CASE sum(il.linelistamt)
+            WHEN 0 THEN 0
+            ELSE round((sum(il.linelistamt) - sum(il.linenetamt)) / sum(il.linelistamt) * 100, 2)
+        END AS linediscount, sum(il.lineoverlimitamt) AS lineoverlimitamt, 
+        CASE sum(il.linenetamt)
+            WHEN 0 THEN 0
+            ELSE 100 - round((sum(il.linenetamt) - sum(il.lineoverlimitamt)) / sum(il.linenetamt) * 100, 2)
+        END AS lineoverlimit, sum(il.qtyinvoiced) AS qtyinvoiced
+   FROM rv_c_invoiceline il
+  GROUP BY il.ad_client_id, il.ad_org_id, il.c_bpartner_id, il.m_product_category_id, TRUNC(il.dateinvoiced, 'Q')]]></view>
   </database>
--- a/src-db/database/model/views/RV_C_INVOICE_CUSTOMERVENDQTR.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_C_INVOICE_CUSTOMERVENDQTR.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,16 +1,15 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_C_INVOICE_CUSTOMERVENDQTR">
     <view name="RV_C_INVOICE_CUSTOMERVENDQTR"><![CDATA[SELECT il.ad_client_id, il.ad_org_id, il.c_bpartner_id, po.c_bpartner_id AS vendor_id, TRUNC(il.dateinvoiced, 'Q') AS dateinvoiced, sum(il.linenetamt) AS linenetamt, sum(il.linelistamt) AS linelistamt, sum(il.linelimitamt) AS linelimitamt, sum(il.linediscountamt) AS linediscountamt, 
-CASE sum(il.linelistamt)
-WHEN 0 THEN 0
-ELSE round((sum(il.linelistamt) - sum(il.linenetamt)) / sum(il.linelistamt) * 100, 2)
-END AS linediscount, sum(il.lineoverlimitamt) AS lineoverlimitamt, 
-CASE sum(il.linenetamt)
-WHEN 0 THEN 0
-ELSE 100 - round((sum(il.linenetamt) - sum(il.lineoverlimitamt)) / sum(il.linenetamt) * 100, 2)
-END AS lineoverlimit, sum(il.qtyinvoiced) AS qtyinvoiced
-FROM rv_c_invoiceline il, m_product_po po
-WHERE il.m_product_id = po.m_product_id
-GROUP BY il.ad_client_id, il.ad_org_id, il.c_bpartner_id, po.c_bpartner_id, TRUNC(il.dateinvoiced, 'Q')
-]]></view>
+        CASE sum(il.linelistamt)
+            WHEN 0 THEN 0
+            ELSE round((sum(il.linelistamt) - sum(il.linenetamt)) / sum(il.linelistamt) * 100, 2)
+        END AS linediscount, sum(il.lineoverlimitamt) AS lineoverlimitamt, 
+        CASE sum(il.linenetamt)
+            WHEN 0 THEN 0
+            ELSE 100 - round((sum(il.linenetamt) - sum(il.lineoverlimitamt)) / sum(il.linenetamt) * 100, 2)
+        END AS lineoverlimit, sum(il.qtyinvoiced) AS qtyinvoiced
+   FROM rv_c_invoiceline il, m_product_po po
+  WHERE il.m_product_id = po.m_product_id
+  GROUP BY il.ad_client_id, il.ad_org_id, il.c_bpartner_id, po.c_bpartner_id, TRUNC(il.dateinvoiced, 'Q')]]></view>
   </database>
--- a/src-db/database/model/views/RV_C_INVOICE_DAY.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_C_INVOICE_DAY.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,15 +1,14 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_C_INVOICE_DAY">
     <view name="RV_C_INVOICE_DAY"><![CDATA[SELECT rv_c_invoiceline.ad_client_id, rv_c_invoiceline.ad_org_id, rv_c_invoiceline.salesrep_id, TRUNC(rv_c_invoiceline.dateinvoiced, 'DD') AS dateinvoiced, sum(rv_c_invoiceline.linenetamt) AS linenetamt, sum(rv_c_invoiceline.linelistamt) AS linelistamt, sum(rv_c_invoiceline.linelimitamt) AS linelimitamt, sum(rv_c_invoiceline.linediscountamt) AS linediscountamt, 
-CASE sum(rv_c_invoiceline.linelistamt)
-WHEN 0 THEN 0
-ELSE round((sum(rv_c_invoiceline.linelistamt) - sum(rv_c_invoiceline.linenetamt)) / sum(rv_c_invoiceline.linelistamt) * 100, 2)
-END AS linediscount, sum(rv_c_invoiceline.lineoverlimitamt) AS lineoverlimitamt, 
-CASE sum(rv_c_invoiceline.linenetamt)
-WHEN 0 THEN 0
-ELSE 100 - round((sum(rv_c_invoiceline.linenetamt) - sum(rv_c_invoiceline.lineoverlimitamt)) / sum(rv_c_invoiceline.linenetamt) * 100, 2)
-END AS lineoverlimit
-FROM rv_c_invoiceline
-GROUP BY rv_c_invoiceline.ad_client_id, rv_c_invoiceline.ad_org_id, rv_c_invoiceline.salesrep_id, TRUNC(rv_c_invoiceline.dateinvoiced, 'DD')
-]]></view>
+        CASE sum(rv_c_invoiceline.linelistamt)
+            WHEN 0 THEN 0
+            ELSE round((sum(rv_c_invoiceline.linelistamt) - sum(rv_c_invoiceline.linenetamt)) / sum(rv_c_invoiceline.linelistamt) * 100, 2)
+        END AS linediscount, sum(rv_c_invoiceline.lineoverlimitamt) AS lineoverlimitamt, 
+        CASE sum(rv_c_invoiceline.linenetamt)
+            WHEN 0 THEN 0
+            ELSE 100 - round((sum(rv_c_invoiceline.linenetamt) - sum(rv_c_invoiceline.lineoverlimitamt)) / sum(rv_c_invoiceline.linenetamt) * 100, 2)
+        END AS lineoverlimit
+   FROM rv_c_invoiceline
+  GROUP BY rv_c_invoiceline.ad_client_id, rv_c_invoiceline.ad_org_id, rv_c_invoiceline.salesrep_id, TRUNC(rv_c_invoiceline.dateinvoiced, 'DD')]]></view>
   </database>
--- a/src-db/database/model/views/RV_C_INVOICE_MONTH.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_C_INVOICE_MONTH.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,15 +1,14 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_C_INVOICE_MONTH">
     <view name="RV_C_INVOICE_MONTH"><![CDATA[SELECT rv_c_invoiceline.ad_client_id, rv_c_invoiceline.ad_org_id, rv_c_invoiceline.salesrep_id, TRUNC(rv_c_invoiceline.dateinvoiced, 'MM') AS dateinvoiced, sum(rv_c_invoiceline.linenetamt) AS linenetamt, sum(rv_c_invoiceline.linelistamt) AS linelistamt, sum(rv_c_invoiceline.linelimitamt) AS linelimitamt, sum(rv_c_invoiceline.linediscountamt) AS linediscountamt, 
-CASE sum(rv_c_invoiceline.linelistamt)
-WHEN 0 THEN 0
-ELSE round((sum(rv_c_invoiceline.linelistamt) - sum(rv_c_invoiceline.linenetamt)) / sum(rv_c_invoiceline.linelistamt) * 100, 2)
-END AS linediscount, sum(rv_c_invoiceline.lineoverlimitamt) AS lineoverlimitamt, 
-CASE sum(rv_c_invoiceline.linenetamt)
-WHEN 0 THEN 0
-ELSE 100 - round((sum(rv_c_invoiceline.linenetamt) - sum(rv_c_invoiceline.lineoverlimitamt)) / sum(rv_c_invoiceline.linenetamt) * 100, 2)
-END AS lineoverlimit
-FROM rv_c_invoiceline
-GROUP BY rv_c_invoiceline.ad_client_id, rv_c_invoiceline.ad_org_id, rv_c_invoiceline.salesrep_id, TRUNC(rv_c_invoiceline.dateinvoiced, 'MM')
-]]></view>
+        CASE sum(rv_c_invoiceline.linelistamt)
+            WHEN 0 THEN 0
+            ELSE round((sum(rv_c_invoiceline.linelistamt) - sum(rv_c_invoiceline.linenetamt)) / sum(rv_c_invoiceline.linelistamt) * 100, 2)
+        END AS linediscount, sum(rv_c_invoiceline.lineoverlimitamt) AS lineoverlimitamt, 
+        CASE sum(rv_c_invoiceline.linenetamt)
+            WHEN 0 THEN 0
+            ELSE 100 - round((sum(rv_c_invoiceline.linenetamt) - sum(rv_c_invoiceline.lineoverlimitamt)) / sum(rv_c_invoiceline.linenetamt) * 100, 2)
+        END AS lineoverlimit
+   FROM rv_c_invoiceline
+  GROUP BY rv_c_invoiceline.ad_client_id, rv_c_invoiceline.ad_org_id, rv_c_invoiceline.salesrep_id, TRUNC(rv_c_invoiceline.dateinvoiced, 'MM')]]></view>
   </database>
--- a/src-db/database/model/views/RV_C_INVOICE_PRODMONTH.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_C_INVOICE_PRODMONTH.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,15 +1,14 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_C_INVOICE_PRODMONTH">
     <view name="RV_C_INVOICE_PRODMONTH"><![CDATA[SELECT il.ad_client_id, il.ad_org_id, il.m_product_category_id, TRUNC(il.dateinvoiced, 'MM') AS dateinvoiced, sum(il.linenetamt) AS linenetamt, sum(il.linelistamt) AS linelistamt, sum(il.linelimitamt) AS linelimitamt, sum(il.linediscountamt) AS linediscountamt, 
-CASE sum(il.linelistamt)
-WHEN 0 THEN 0
-ELSE round((sum(il.linelistamt) - sum(il.linenetamt)) / sum(il.linelistamt) * 100, 2)
-END AS linediscount, sum(il.lineoverlimitamt) AS lineoverlimitamt, 
-CASE sum(il.linenetamt)
-WHEN 0 THEN 0
-ELSE 100 - round((sum(il.linenetamt) - sum(il.lineoverlimitamt)) / sum(il.linenetamt) * 100, 2)
-END AS lineoverlimit, sum(il.qtyinvoiced) AS qtyinvoiced
-FROM rv_c_invoiceline il
-GROUP BY il.ad_client_id, il.ad_org_id, il.m_product_category_id, TRUNC(il.dateinvoiced, 'MM')
-]]></view>
+        CASE sum(il.linelistamt)
+            WHEN 0 THEN 0
+            ELSE round((sum(il.linelistamt) - sum(il.linenetamt)) / sum(il.linelistamt) * 100, 2)
+        END AS linediscount, sum(il.lineoverlimitamt) AS lineoverlimitamt, 
+        CASE sum(il.linenetamt)
+            WHEN 0 THEN 0
+            ELSE 100 - round((sum(il.linenetamt) - sum(il.lineoverlimitamt)) / sum(il.linenetamt) * 100, 2)
+        END AS lineoverlimit, sum(il.qtyinvoiced) AS qtyinvoiced
+   FROM rv_c_invoiceline il
+  GROUP BY il.ad_client_id, il.ad_org_id, il.m_product_category_id, TRUNC(il.dateinvoiced, 'MM')]]></view>
   </database>
--- a/src-db/database/model/views/RV_C_INVOICE_PRODWEEK.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_C_INVOICE_PRODWEEK.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,15 +1,14 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_C_INVOICE_PRODWEEK">
     <view name="RV_C_INVOICE_PRODWEEK"><![CDATA[SELECT il.ad_client_id, il.ad_org_id, il.m_product_category_id, TRUNC(il.dateinvoiced, 'DY') AS dateinvoiced, sum(il.linenetamt) AS linenetamt, sum(il.linelistamt) AS linelistamt, sum(il.linelimitamt) AS linelimitamt, sum(il.linediscountamt) AS linediscountamt, 
-CASE sum(il.linelistamt)
-WHEN 0 THEN 0
-ELSE round((sum(il.linelistamt) - sum(il.linenetamt)) / sum(il.linelistamt) * 100, 2)
-END AS linediscount, sum(il.lineoverlimitamt) AS lineoverlimitamt, 
-CASE sum(il.linenetamt)
-WHEN 0 THEN 0
-ELSE 100 - round((sum(il.linenetamt) - sum(il.lineoverlimitamt)) / sum(il.linenetamt) * 100, 2)
-END AS lineoverlimit, sum(il.qtyinvoiced) AS qtyinvoiced
-FROM rv_c_invoiceline il
-GROUP BY il.ad_client_id, il.ad_org_id, il.m_product_category_id, TRUNC(il.dateinvoiced, 'DY')
-]]></view>
+        CASE sum(il.linelistamt)
+            WHEN 0 THEN 0
+            ELSE round((sum(il.linelistamt) - sum(il.linenetamt)) / sum(il.linelistamt) * 100, 2)
+        END AS linediscount, sum(il.lineoverlimitamt) AS lineoverlimitamt, 
+        CASE sum(il.linenetamt)
+            WHEN 0 THEN 0
+            ELSE 100 - round((sum(il.linenetamt) - sum(il.lineoverlimitamt)) / sum(il.linenetamt) * 100, 2)
+        END AS lineoverlimit, sum(il.qtyinvoiced) AS qtyinvoiced
+   FROM rv_c_invoiceline il
+  GROUP BY il.ad_client_id, il.ad_org_id, il.m_product_category_id, TRUNC(il.dateinvoiced, 'DY')]]></view>
   </database>
--- a/src-db/database/model/views/RV_C_INVOICE_VENDORMONTH.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_C_INVOICE_VENDORMONTH.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,16 +1,15 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_C_INVOICE_VENDORMONTH">
     <view name="RV_C_INVOICE_VENDORMONTH"><![CDATA[SELECT il.ad_client_id, il.ad_org_id, po.c_bpartner_id, TRUNC(il.dateinvoiced, 'MM') AS dateinvoiced, sum(il.linenetamt) AS linenetamt, sum(il.linelistamt) AS linelistamt, sum(il.linelimitamt) AS linelimitamt, sum(il.linediscountamt) AS linediscountamt, 
-CASE sum(il.linelistamt)
-WHEN 0 THEN 0
-ELSE round((sum(il.linelistamt) - sum(il.linenetamt)) / sum(il.linelistamt) * 100, 2)
-END AS linediscount, sum(il.lineoverlimitamt) AS lineoverlimitamt, 
-CASE sum(il.linenetamt)
-WHEN 0 THEN 0
-ELSE 100 - round((sum(il.linenetamt) - sum(il.lineoverlimitamt)) / sum(il.linenetamt) * 100, 2)
-END AS lineoverlimit, sum(il.qtyinvoiced) AS qtyinvoiced
-FROM rv_c_invoiceline il, m_product_po po
-WHERE il.m_product_id = po.m_product_id
-GROUP BY il.ad_client_id, il.ad_org_id, po.c_bpartner_id, TRUNC(il.dateinvoiced, 'MM')
-]]></view>
+        CASE sum(il.linelistamt)
+            WHEN 0 THEN 0
+            ELSE round((sum(il.linelistamt) - sum(il.linenetamt)) / sum(il.linelistamt) * 100, 2)
+        END AS linediscount, sum(il.lineoverlimitamt) AS lineoverlimitamt, 
+        CASE sum(il.linenetamt)
+            WHEN 0 THEN 0
+            ELSE 100 - round((sum(il.linenetamt) - sum(il.lineoverlimitamt)) / sum(il.linenetamt) * 100, 2)
+        END AS lineoverlimit, sum(il.qtyinvoiced) AS qtyinvoiced
+   FROM rv_c_invoiceline il, m_product_po po
+  WHERE il.m_product_id = po.m_product_id
+  GROUP BY il.ad_client_id, il.ad_org_id, po.c_bpartner_id, TRUNC(il.dateinvoiced, 'MM')]]></view>
   </database>
--- a/src-db/database/model/views/RV_C_INVOICE_WEEK.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_C_INVOICE_WEEK.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,15 +1,14 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_C_INVOICE_WEEK">
     <view name="RV_C_INVOICE_WEEK"><![CDATA[SELECT rv_c_invoiceline.ad_client_id, rv_c_invoiceline.ad_org_id, rv_c_invoiceline.salesrep_id, TRUNC(rv_c_invoiceline.dateinvoiced, 'DY') AS dateinvoiced, sum(rv_c_invoiceline.linenetamt) AS linenetamt, sum(rv_c_invoiceline.linelistamt) AS linelistamt, sum(rv_c_invoiceline.linelimitamt) AS linelimitamt, sum(rv_c_invoiceline.linediscountamt) AS linediscountamt, 
-CASE sum(rv_c_invoiceline.linelistamt)
-WHEN 0 THEN 0
-ELSE round((sum(rv_c_invoiceline.linelistamt) - sum(rv_c_invoiceline.linenetamt)) / sum(rv_c_invoiceline.linelistamt) * 100, 2)
-END AS linediscount, sum(rv_c_invoiceline.lineoverlimitamt) AS lineoverlimitamt, 
-CASE sum(rv_c_invoiceline.linenetamt)
-WHEN 0 THEN 0
-ELSE 100 - round((sum(rv_c_invoiceline.linenetamt) - sum(rv_c_invoiceline.lineoverlimitamt)) / sum(rv_c_invoiceline.linenetamt) * 100, 2)
-END AS lineoverlimit
-FROM rv_c_invoiceline
-GROUP BY rv_c_invoiceline.ad_client_id, rv_c_invoiceline.ad_org_id, rv_c_invoiceline.salesrep_id, TRUNC(rv_c_invoiceline.dateinvoiced, 'DY')
-]]></view>
+        CASE sum(rv_c_invoiceline.linelistamt)
+            WHEN 0 THEN 0
+            ELSE round((sum(rv_c_invoiceline.linelistamt) - sum(rv_c_invoiceline.linenetamt)) / sum(rv_c_invoiceline.linelistamt) * 100, 2)
+        END AS linediscount, sum(rv_c_invoiceline.lineoverlimitamt) AS lineoverlimitamt, 
+        CASE sum(rv_c_invoiceline.linenetamt)
+            WHEN 0 THEN 0
+            ELSE 100 - round((sum(rv_c_invoiceline.linenetamt) - sum(rv_c_invoiceline.lineoverlimitamt)) / sum(rv_c_invoiceline.linenetamt) * 100, 2)
+        END AS lineoverlimit
+   FROM rv_c_invoiceline
+  GROUP BY rv_c_invoiceline.ad_client_id, rv_c_invoiceline.ad_org_id, rv_c_invoiceline.salesrep_id, TRUNC(rv_c_invoiceline.dateinvoiced, 'DY')]]></view>
   </database>
--- a/src-db/database/model/views/RV_M_TRANSACTION.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_M_TRANSACTION.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,7 +1,6 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_M_TRANSACTION">
     <view name="RV_M_TRANSACTION"><![CDATA[SELECT t.ad_client_id, t.ad_org_id, 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>
+   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/RV_M_TRANSACTION_SUM.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_M_TRANSACTION_SUM.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,8 +1,7 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_M_TRANSACTION_SUM">
     <view name="RV_M_TRANSACTION_SUM"><![CDATA[SELECT t.ad_client_id, t.ad_org_id, t.movementtype, l.m_warehouse_id, t.m_locator_id, t.m_product_id, t.movementdate, sum(t.movementqty) AS movementqty
-FROM m_transaction t, m_locator l
-WHERE t.m_locator_id = l.m_locator_id
-GROUP BY t.ad_client_id, t.ad_org_id, t.movementtype, l.m_warehouse_id, t.m_locator_id, t.m_product_id, t.movementdate
-]]></view>
+   FROM m_transaction t, m_locator l
+  WHERE t.m_locator_id = l.m_locator_id
+  GROUP BY t.ad_client_id, t.ad_org_id, t.movementtype, l.m_warehouse_id, t.m_locator_id, t.m_product_id, t.movementdate]]></view>
   </database>
--- a/src-db/database/model/views/RV_ORDER_OPEN.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_ORDER_OPEN.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,7 +1,6 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_ORDER_OPEN">
     <view name="RV_ORDER_OPEN"><![CDATA[SELECT l.ad_client_id, l.ad_org_id, l.isactive, l.created, l.createdby, l.updated, l.updatedby, o.c_order_id, o.docstatus, o.docaction, o.c_doctype_id, o.isapproved, o.iscreditapproved, o.salesrep_id, o.c_bpartner_id, o.c_bpartner_location_id, o.ad_user_id, o.poreference, o.c_currency_id, o.issotrx, l.c_orderline_id, l.dateordered, l.datepromised, l.m_product_id, l.m_warehouse_id, l.directship, l.c_uom_id, l.qtyordered, l.qtyreserved, l.qtydelivered, l.qtyinvoiced, l.priceactual, l.qtyordered - l.qtydelivered AS qtytodeliver, l.qtyordered - l.qtyinvoiced AS qtytoinvoice, (l.qtyordered - l.qtyinvoiced) * l.priceactual AS netamttoinvoice
-FROM c_order o, c_orderline l
-WHERE o.c_order_id = l.c_order_id AND (l.qtyordered <> l.qtydelivered OR l.qtyordered <> l.qtyinvoiced)
-]]></view>
+   FROM c_order o, c_orderline l
+  WHERE o.c_order_id = l.c_order_id AND (l.qtyordered <> l.qtydelivered OR l.qtyordered <> l.qtyinvoiced)]]></view>
   </database>
--- a/src-db/database/model/views/RV_PRODUCT_COSTING.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_PRODUCT_COSTING.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,19 +1,18 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_PRODUCT_COSTING">
     <view name="RV_PRODUCT_COSTING"><![CDATA[SELECT pc.m_product_id, pc.c_acctschema_id, p.value, p.name, p.m_product_category_id, pc.ad_client_id, pc.ad_org_id, pc.isactive, pc.created, pc.createdby, pc.updated, pc.updatedby, pc.currentcostprice, pc.futurecostprice, pc.coststandard, pc.coststandardpoqty, pc.coststandardpoamt, 
-CASE pc.coststandardpoqty
-WHEN 0 THEN 0
-ELSE pc.coststandardpoamt / pc.coststandardpoqty
-END AS coststandardpodiff, pc.coststandardcumqty, pc.coststandardcumamt, 
-CASE pc.coststandardcumqty
-WHEN 0 THEN 0
-ELSE pc.coststandardcumamt / pc.coststandardcumqty
-END AS coststandardinvdiff, pc.costaverage, pc.costaveragecumqty, pc.costaveragecumamt, pc.totalinvqty, pc.totalinvamt, 
-CASE pc.totalinvqty
-WHEN 0 THEN 0
-ELSE pc.totalinvamt / pc.totalinvqty
-END AS totalinvcost, pc.pricelastpo, pc.pricelastinv
-FROM m_product_costing pc, m_product p
-WHERE pc.m_product_id = p.m_product_id
-]]></view>
+        CASE pc.coststandardpoqty
+            WHEN 0 THEN 0
+            ELSE pc.coststandardpoamt / pc.coststandardpoqty
+        END AS coststandardpodiff, pc.coststandardcumqty, pc.coststandardcumamt, 
+        CASE pc.coststandardcumqty
+            WHEN 0 THEN 0
+            ELSE pc.coststandardcumamt / pc.coststandardcumqty
+        END AS coststandardinvdiff, pc.costaverage, pc.costaveragecumqty, pc.costaveragecumamt, pc.totalinvqty, pc.totalinvamt, 
+        CASE pc.totalinvqty
+            WHEN 0 THEN 0
+            ELSE pc.totalinvamt / pc.totalinvqty
+        END AS totalinvcost, pc.pricelastpo, pc.pricelastinv
+   FROM m_product_costing pc, m_product p
+  WHERE pc.m_product_id = p.m_product_id]]></view>
   </database>
--- a/src-db/database/model/views/RV_PROJECTCYCLE.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/RV_PROJECTCYCLE.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,11 +1,10 @@
 <?xml version="1.0"?>
   <database name="VIEW RV_PROJECTCYCLE">
     <view name="RV_PROJECTCYCLE"><![CDATA[SELECT p.ad_client_id, p.ad_org_id, p.isactive, p.created, p.createdby, p.updated, p.updatedby, c.c_cycle_id, c.name AS cyclename, c.c_currency_id, cs.c_cyclestep_id, cs.name AS cyclestepname, cs.seqno, cs.relativeweight, pp.c_phase_id, pp.name AS projectphasename, pt.c_projecttype_id, pt.name AS projecttypename, p.value AS projectvalue, p.name AS projectname, p.description, p.note, p.c_bpartner_id, p.c_bpartner_location_id, p.ad_user_id, p.poreference, p.salesrep_id, p.m_warehouse_id, p.projectcategory, p.datecontract, p.datefinish, p.iscommitment, p.iscommitceiling, p.committedqty * cs.relativeweight AS committedqty, c_currency_convert(p.committedamt, p.c_currency_id, c.c_currency_id, to_date(now()), 'S', p.ad_client_id, p.ad_org_id) * cs.relativeweight AS committedamt, p.plannedqty * cs.relativeweight AS plannedqty, c_currency_convert(p.plannedamt, p.c_currency_id, c.c_currency_id, to_date(now()), 'S', p.ad_client_id, p.ad_org_id) * cs.relativeweight AS plannedamt, c_currency_convert(p.plannedmarginamt, p.c_currency_id, c.c_currency_id, to_date(now()), 'S', p.ad_client_id, p.ad_org_id) * cs.relativeweight AS plannedmarginamt, c_currency_convert(p.invoicedamt, p.c_currency_id, c.c_currency_id, to_date(now()), 'S', p.ad_client_id, p.ad_org_id) * cs.relativeweight AS invoicedamt, p.invoicedqty * cs.relativeweight AS invoicedqty, c_currency_convert(p.projectbalanceamt, p.c_currency_id, c.c_currency_id, to_date(now()), 'S', p.ad_client_id, p.ad_org_id) * cs.relativeweight AS projectbalanceamt
-FROM c_cycle c
-JOIN c_cyclestep cs ON c.c_cycle_id = cs.c_cycle_id
-JOIN c_cyclephase cp ON cs.c_cyclestep_id = cp.c_cyclestep_id
-JOIN c_phase pp ON cp.c_phase_id = pp.c_phase_id
-JOIN c_project p ON cp.c_phase_id = p.c_phase_id
-JOIN c_projecttype pt ON p.c_projecttype_id = pt.c_projecttype_id
-]]></view>
+   FROM c_cycle c
+   JOIN c_cyclestep cs ON c.c_cycle_id = cs.c_cycle_id
+   JOIN c_cyclephase cp ON cs.c_cyclestep_id = cp.c_cyclestep_id
+   JOIN c_phase pp ON cp.c_phase_id = pp.c_phase_id
+   JOIN c_project p ON cp.c_phase_id = p.c_phase_id
+   JOIN c_projecttype pt ON p.c_projecttype_id = pt.c_projecttype_id]]></view>
   </database>
--- a/src-db/database/model/views/R_REQUEST_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/R_REQUEST_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,7 +1,6 @@
 <?xml version="1.0"?>
   <database name="VIEW R_REQUEST_V">
     <view name="R_REQUEST_V"><![CDATA[SELECT r_request.r_request_id, r_request.ad_client_id, r_request.ad_org_id, r_request.isactive, r_request.created, r_request.createdby, r_request.updated, r_request.updatedby, r_request.documentno, r_request.requestamt, r_request.priority, r_request.duetype, r_request.summary, r_request.isescalated, r_request.datelastaction, r_request.lastresult, r_request.ad_user_id, r_request.c_bpartner_id, r_request.c_campaign_id, r_request.c_order_id, r_request.c_invoice_id, r_request.c_debt_payment_id, r_request.m_product_id, r_request.c_project_id, r_request.actiontype, r_request.r_mailtext_id, r_request.mailsubject, r_request.mailtext, r_request.result, r_request.nextaction, r_request.datenextaction, r_request.processing, r_request.processed, r_request.r_requesttype_id, r_request.salesrep_id, r_request.isselfservice
-FROM r_request
-WHERE r_request.isactive = 'Y' AND r_request.processed = 'N' AND now() > r_request.datenextaction
-]]></view>
+   FROM r_request
+  WHERE r_request.isactive = 'Y' AND r_request.processed = 'N' AND now() > r_request.datenextaction]]></view>
   </database>
--- a/src-db/database/model/views/S_TIMEEXPENSELINE_V.xml	Fri Apr 25 11:13:50 2008 +0000
+++ b/src-db/database/model/views/S_TIMEEXPENSELINE_V.xml	Fri Apr 25 13:58:34 2008 +0000
@@ -1,8 +1,7 @@
 <?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
-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>
+   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>