Some views have been renamed due to changes in the used prefixes
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Thu, 09 Oct 2008 12:06:24 +0000
changeset 1785 6fcdedddde3d
parent 1784 25ef6d12f03b
child 1786 20694e60728c
Some views have been renamed due to changes in the used prefixes

Modified views are: (old name, new name)

REPORT_PROJECTPROPOSAL C_PROJECTPROPOSAL_V
RV_BPARTNER C_BPARTNER_V
RV_CASH_DETAIL C_CASH_DETAIL
RV_C_INVOICE_CUSTOMERPRODQTR C_INVOICE_CUSTOMERPRODQTR
RV_C_INVOICE_CUSTOMERVENDQTR C_INVOICE_CUSTOMERVENDQTR
RV_C_INVOICE_DAY C_INVOICE_DAY
RV_C_INVOICELINE C_INVOICELINE_V
RV_C_INVOICE_MONTH C_INVOICE_MONTH
RV_C_INVOICE_PRODMONTH C_INVOICE_PRODMONTH
RV_C_INVOICE_PRODWEEK C_INVOICE_PRODWEEK
RV_C_INVOICE_VENDORMONTH C_INVOICE_VENDORMONTH
RV_C_INVOICE_WEEK C_INVOICE_WEEK
RV_C_INVOICE C_INVOICE_V2
RV_M_TRANSACTION_SUM M_TRANSACTION_SUM
RV_M_TRANSACTION M_TRANSACTION_V
RV_ORDER_OPEN C_ORDER_OPEN
src-db/database/model/views/C_BPARTNER_V.xml
src-db/database/model/views/C_CASH_DETAIL.xml
src-db/database/model/views/C_INVOICELINE_V2.xml
src-db/database/model/views/C_INVOICE_CUSTOMERPRODQTR.xml
src-db/database/model/views/C_INVOICE_CUSTOMERVENDQTR.xml
src-db/database/model/views/C_INVOICE_DAY.xml
src-db/database/model/views/C_INVOICE_MONTH.xml
src-db/database/model/views/C_INVOICE_PRODMONTH.xml
src-db/database/model/views/C_INVOICE_PRODWEEK.xml
src-db/database/model/views/C_INVOICE_V2.xml
src-db/database/model/views/C_INVOICE_VENDORMONTH.xml
src-db/database/model/views/C_INVOICE_WEEK.xml
src-db/database/model/views/C_ORDER_OPEN.xml
src-db/database/model/views/C_PROJECTPROPOSAL_V.xml
src-db/database/model/views/M_TRANSACTION_SUM.xml
src-db/database/model/views/M_TRANSACTION_V.xml
src-db/database/model/views/REPORT_PROJECTPROPOSAL.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/sampledata/AD_SEQUENCE.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_PROCESS.xml
src-db/database/sourcedata/AD_TABLE.xml
src/org/openbravo/erpCommon/ad_reports/ReportInvoicesEditJR.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportInvoices_data.xsql
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/views/C_BPARTNER_V.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+  <database name="VIEW C_BPARTNER_V">
+    <view name="C_BPARTNER_V"><![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>
+  </database>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/views/C_CASH_DETAIL.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+  <database name="VIEW C_CASH_DETAIL">
+    <view name="C_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>
+  </database>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/views/C_INVOICELINE_V2.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+  <database name="VIEW C_INVOICELINE_V2">
+    <view name="C_INVOICELINE_V2"><![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 c_invoice_v2 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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/views/C_INVOICE_CUSTOMERPRODQTR.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+  <database name="VIEW C_INVOICE_CUSTOMERPRODQTR">
+    <view name="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 c_invoiceline_v2 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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/views/C_INVOICE_CUSTOMERVENDQTR.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+  <database name="VIEW C_INVOICE_CUSTOMERVENDQTR">
+    <view name="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 c_invoiceline_v2 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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/views/C_INVOICE_DAY.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+  <database name="VIEW C_INVOICE_DAY">
+    <view name="C_INVOICE_DAY"><![CDATA[SELECT c_invoiceline_v2.ad_client_id, c_invoiceline_v2.ad_org_id, c_invoiceline_v2.salesrep_id, TRUNC(c_invoiceline_v2.dateinvoiced, 'DD') AS dateinvoiced, sum(c_invoiceline_v2.linenetamt) AS linenetamt, sum(c_invoiceline_v2.linelistamt) AS linelistamt, sum(c_invoiceline_v2.linelimitamt) AS linelimitamt, sum(c_invoiceline_v2.linediscountamt) AS linediscountamt, 
+        CASE sum(c_invoiceline_v2.linelistamt)
+            WHEN 0 THEN 0
+            ELSE round((sum(c_invoiceline_v2.linelistamt) - sum(c_invoiceline_v2.linenetamt)) / sum(c_invoiceline_v2.linelistamt) * 100, 2)
+        END AS linediscount, sum(c_invoiceline_v2.lineoverlimitamt) AS lineoverlimitamt, 
+        CASE sum(c_invoiceline_v2.linenetamt)
+            WHEN 0 THEN 0
+            ELSE 100 - round((sum(c_invoiceline_v2.linenetamt) - sum(c_invoiceline_v2.lineoverlimitamt)) / sum(c_invoiceline_v2.linenetamt) * 100, 2)
+        END AS lineoverlimit
+   FROM c_invoiceline_v2
+  GROUP BY c_invoiceline_v2.ad_client_id, c_invoiceline_v2.ad_org_id, c_invoiceline_v2.salesrep_id, TRUNC(c_invoiceline_v2.dateinvoiced, 'DD')]]></view>
+  </database>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/views/C_INVOICE_MONTH.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+  <database name="VIEW C_INVOICE_MONTH">
+    <view name="C_INVOICE_MONTH"><![CDATA[SELECT c_invoiceline_v2.ad_client_id, c_invoiceline_v2.ad_org_id, c_invoiceline_v2.salesrep_id, TRUNC(c_invoiceline_v2.dateinvoiced, 'MM') AS dateinvoiced, sum(c_invoiceline_v2.linenetamt) AS linenetamt, sum(c_invoiceline_v2.linelistamt) AS linelistamt, sum(c_invoiceline_v2.linelimitamt) AS linelimitamt, sum(c_invoiceline_v2.linediscountamt) AS linediscountamt, 
+        CASE sum(c_invoiceline_v2.linelistamt)
+            WHEN 0 THEN 0
+            ELSE round((sum(c_invoiceline_v2.linelistamt) - sum(c_invoiceline_v2.linenetamt)) / sum(c_invoiceline_v2.linelistamt) * 100, 2)
+        END AS linediscount, sum(c_invoiceline_v2.lineoverlimitamt) AS lineoverlimitamt, 
+        CASE sum(c_invoiceline_v2.linenetamt)
+            WHEN 0 THEN 0
+            ELSE 100 - round((sum(c_invoiceline_v2.linenetamt) - sum(c_invoiceline_v2.lineoverlimitamt)) / sum(c_invoiceline_v2.linenetamt) * 100, 2)
+        END AS lineoverlimit
+   FROM c_invoiceline_v2
+  GROUP BY c_invoiceline_v2.ad_client_id, c_invoiceline_v2.ad_org_id, c_invoiceline_v2.salesrep_id, TRUNC(c_invoiceline_v2.dateinvoiced, 'MM')]]></view>
+  </database>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/views/C_INVOICE_PRODMONTH.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+  <database name="VIEW C_INVOICE_PRODMONTH">
+    <view name="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 c_invoiceline_v2 il
+  GROUP BY il.ad_client_id, il.ad_org_id, il.m_product_category_id, TRUNC(il.dateinvoiced, 'MM')]]></view>
+  </database>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/views/C_INVOICE_PRODWEEK.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+  <database name="VIEW C_INVOICE_PRODWEEK">
+    <view name="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 c_invoiceline_v2 il
+  GROUP BY il.ad_client_id, il.ad_org_id, il.m_product_category_id, TRUNC(il.dateinvoiced, 'DY')]]></view>
+  </database>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/views/C_INVOICE_V2.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+  <database name="VIEW C_INVOICE_V2">
+    <view name="C_INVOICE_V2"><![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.c_doctype_id, i.c_doctypetarget_id, i.c_order_id, i.description, i.salesrep_id, i.dateinvoiced, i.dateprinted, i.dateacct, i.c_bpartner_id, i.c_bpartner_location_id, i.ad_user_id, b.c_bp_group_id, i.poreference, i.dateordered, i.c_currency_id, i.paymentrule, i.c_paymentterm_id, i.m_pricelist_id, i.c_campaign_id, i.c_project_id, i.c_activity_id, i.c_charge_id, 
+        CASE substr(d.docbasetype, 3)
+            WHEN 'C' THEN i.chargeamt * (-1)
+            ELSE i.chargeamt
+        END AS chargeamt, 
+        CASE substr(d.docbasetype, 3)
+            WHEN 'C' THEN i.totallines * (-1)
+            ELSE i.totallines
+        END AS totallines, 
+        CASE substr(d.docbasetype, 3)
+            WHEN 'C' THEN i.grandtotal * (-1)
+            ELSE i.grandtotal
+        END AS grandtotal, 
+        CASE substr(d.docbasetype, 3)
+            WHEN 'C' THEN (-1)
+            ELSE 1
+        END AS multiplier
+   FROM c_invoice i, c_doctype d, c_bpartner b
+  WHERE i.c_doctype_id = d.c_doctype_id AND i.c_bpartner_id = b.c_bpartner_id]]></view>
+  </database>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/views/C_INVOICE_VENDORMONTH.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+  <database name="VIEW C_INVOICE_VENDORMONTH">
+    <view name="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 c_invoiceline_v2 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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/views/C_INVOICE_WEEK.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+  <database name="VIEW C_INVOICE_WEEK">
+    <view name="C_INVOICE_WEEK"><![CDATA[SELECT c_invoiceline_v2.ad_client_id, c_invoiceline_v2.ad_org_id, c_invoiceline_v2.salesrep_id, TRUNC(c_invoiceline_v2.dateinvoiced, 'DY') AS dateinvoiced, sum(c_invoiceline_v2.linenetamt) AS linenetamt, sum(c_invoiceline_v2.linelistamt) AS linelistamt, sum(c_invoiceline_v2.linelimitamt) AS linelimitamt, sum(c_invoiceline_v2.linediscountamt) AS linediscountamt, 
+        CASE sum(c_invoiceline_v2.linelistamt)
+            WHEN 0 THEN 0
+            ELSE round((sum(c_invoiceline_v2.linelistamt) - sum(c_invoiceline_v2.linenetamt)) / sum(c_invoiceline_v2.linelistamt) * 100, 2)
+        END AS linediscount, sum(c_invoiceline_v2.lineoverlimitamt) AS lineoverlimitamt, 
+        CASE sum(c_invoiceline_v2.linenetamt)
+            WHEN 0 THEN 0
+            ELSE 100 - round((sum(c_invoiceline_v2.linenetamt) - sum(c_invoiceline_v2.lineoverlimitamt)) / sum(c_invoiceline_v2.linenetamt) * 100, 2)
+        END AS lineoverlimit
+   FROM c_invoiceline_v2
+  GROUP BY c_invoiceline_v2.ad_client_id, c_invoiceline_v2.ad_org_id, c_invoiceline_v2.salesrep_id, TRUNC(c_invoiceline_v2.dateinvoiced, 'DY')]]></view>
+  </database>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/views/C_ORDER_OPEN.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+  <database name="VIEW C_ORDER_OPEN">
+    <view name="C_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.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>
+  </database>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/views/C_PROJECTPROPOSAL_V.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+  <database name="VIEW C_PROJECTPROPOSAL_V">
+    <view name="C_PROJECTPROPOSAL_V"><![CDATA[SELECT p.datesend AS fromdatesend, p.datesend AS todatesend, p.ad_client_id, p.ad_org_id, p.ad_user_id, p.c_bpartner_id, p.c_bpartner_location_id, p.c_project_id, p.c_projectproposal_id, p.issotrx, u.firstname, u.lastname, p.datesend, p.created, p.createdby, p.updated, p.updatedby
+   FROM c_projectproposal p, ad_user u, c_project pr
+  WHERE p.ad_user_id = u.ad_user_id AND p.c_project_id = pr.c_project_id AND p.isactive = 'Y' AND pr.isactive = 'Y']]></view>
+  </database>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/views/M_TRANSACTION_SUM.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+  <database name="VIEW M_TRANSACTION_SUM">
+    <view name="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>
+  </database>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/views/M_TRANSACTION_V.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+  <database name="VIEW M_TRANSACTION_V">
+    <view name="M_TRANSACTION_V"><![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>
+  </database>
--- a/src-db/database/model/views/REPORT_PROJECTPROPOSAL.xml	Thu Oct 09 10:46:11 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-<?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, c_project pr
-  WHERE p.ad_user_id = u.ad_user_id AND p.c_project_id = pr.c_project_id AND p.isactive = 'Y' AND pr.isactive = 'Y']]></view>
-  </database>
--- a/src-db/database/model/views/RV_BPARTNER.xml	Thu Oct 09 10:46:11 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-<?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>
-  </database>
--- a/src-db/database/model/views/RV_CASH_DETAIL.xml	Thu Oct 09 10:46:11 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-<?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>
-  </database>
--- a/src-db/database/model/views/RV_C_INVOICE.xml	Thu Oct 09 10:46:11 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-<?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.c_doctype_id, i.c_doctypetarget_id, i.c_order_id, i.description, i.salesrep_id, i.dateinvoiced, i.dateprinted, i.dateacct, i.c_bpartner_id, i.c_bpartner_location_id, i.ad_user_id, b.c_bp_group_id, i.poreference, i.dateordered, i.c_currency_id, i.paymentrule, i.c_paymentterm_id, i.m_pricelist_id, i.c_campaign_id, i.c_project_id, i.c_activity_id, i.c_charge_id, 
-        CASE substr(d.docbasetype, 3)
-            WHEN 'C' THEN i.chargeamt * (-1)
-            ELSE i.chargeamt
-        END AS chargeamt, 
-        CASE substr(d.docbasetype, 3)
-            WHEN 'C' THEN i.totallines * (-1)
-            ELSE i.totallines
-        END AS totallines, 
-        CASE substr(d.docbasetype, 3)
-            WHEN 'C' THEN i.grandtotal * (-1)
-            ELSE i.grandtotal
-        END AS grandtotal, 
-        CASE substr(d.docbasetype, 3)
-            WHEN 'C' THEN (-1)
-            ELSE 1
-        END AS multiplier
-   FROM c_invoice i, c_doctype d, c_bpartner b
-  WHERE i.c_doctype_id = d.c_doctype_id AND i.c_bpartner_id = b.c_bpartner_id]]></view>
-  </database>
--- a/src-db/database/model/views/RV_C_INVOICELINE.xml	Thu Oct 09 10:46:11 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-<?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>
-  </database>
--- a/src-db/database/model/views/RV_C_INVOICE_CUSTOMERPRODQTR.xml	Thu Oct 09 10:46:11 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?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>
-  </database>
--- a/src-db/database/model/views/RV_C_INVOICE_CUSTOMERVENDQTR.xml	Thu Oct 09 10:46:11 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-<?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>
-  </database>
--- a/src-db/database/model/views/RV_C_INVOICE_DAY.xml	Thu Oct 09 10:46:11 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?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>
-  </database>
--- a/src-db/database/model/views/RV_C_INVOICE_MONTH.xml	Thu Oct 09 10:46:11 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?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>
-  </database>
--- a/src-db/database/model/views/RV_C_INVOICE_PRODMONTH.xml	Thu Oct 09 10:46:11 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?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>
-  </database>
--- a/src-db/database/model/views/RV_C_INVOICE_PRODWEEK.xml	Thu Oct 09 10:46:11 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?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>
-  </database>
--- a/src-db/database/model/views/RV_C_INVOICE_VENDORMONTH.xml	Thu Oct 09 10:46:11 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-<?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>
-  </database>
--- a/src-db/database/model/views/RV_C_INVOICE_WEEK.xml	Thu Oct 09 10:46:11 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?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>
-  </database>
--- a/src-db/database/model/views/RV_M_TRANSACTION.xml	Thu Oct 09 10:46:11 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-<?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>
-  </database>
--- a/src-db/database/model/views/RV_M_TRANSACTION_SUM.xml	Thu Oct 09 10:46:11 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-<?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>
-  </database>
--- a/src-db/database/model/views/RV_ORDER_OPEN.xml	Thu Oct 09 10:46:11 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-<?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.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>
-  </database>
--- a/src-db/database/sampledata/AD_SEQUENCE.xml	Thu Oct 09 10:46:11 2008 +0000
+++ b/src-db/database/sampledata/AD_SEQUENCE.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -1017,9 +1017,9 @@
 <!--1000027 UPDATEDBY-->
 <!--1000027-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--1000027 NAME-->
-<!--1000027-->              <NAME><![CDATA[DocumentNo_RV_C_Invoice]]></NAME>
+<!--1000027-->              <NAME><![CDATA[DocumentNo_C_Invoice_V2]]></NAME>
 <!--1000027 DESCRIPTION-->
-<!--1000027-->              <DESCRIPTION><![CDATA[DocumentNo/Value for Table RV_C_Invoice]]></DESCRIPTION>
+<!--1000027-->              <DESCRIPTION><![CDATA[DocumentNo/Value for Table C_Invoice_V2]]></DESCRIPTION>
 <!--1000027 ISAUTOSEQUENCE-->
 <!--1000027-->              <ISAUTOSEQUENCE><![CDATA[Y]]></ISAUTOSEQUENCE>
 <!--1000027 INCREMENTNO-->
@@ -1054,9 +1054,9 @@
 <!--1000028 UPDATEDBY-->
 <!--1000028-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--1000028 NAME-->
-<!--1000028-->              <NAME><![CDATA[DocumentNo_RV_M_Transaction]]></NAME>
+<!--1000028-->              <NAME><![CDATA[DocumentNo_M_Transaction_V]]></NAME>
 <!--1000028 DESCRIPTION-->
-<!--1000028-->              <DESCRIPTION><![CDATA[DocumentNo/Value for Table RV_M_Transaction]]></DESCRIPTION>
+<!--1000028-->              <DESCRIPTION><![CDATA[DocumentNo/Value for Table M_Transaction_V]]></DESCRIPTION>
 <!--1000028 ISAUTOSEQUENCE-->
 <!--1000028-->              <ISAUTOSEQUENCE><![CDATA[Y]]></ISAUTOSEQUENCE>
 <!--1000028 INCREMENTNO-->
@@ -1424,9 +1424,9 @@
 <!--1000038 UPDATEDBY-->
 <!--1000038-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--1000038 NAME-->
-<!--1000038-->              <NAME><![CDATA[DocumentNo_RV_BPartner]]></NAME>
+<!--1000038-->              <NAME><![CDATA[DocumentNo_C_BPartner_V]]></NAME>
 <!--1000038 DESCRIPTION-->
-<!--1000038-->              <DESCRIPTION><![CDATA[DocumentNo/Value for Table RV_BPartner]]></DESCRIPTION>
+<!--1000038-->              <DESCRIPTION><![CDATA[DocumentNo/Value for Table C_BPartner_V]]></DESCRIPTION>
 <!--1000038 ISAUTOSEQUENCE-->
 <!--1000038-->              <ISAUTOSEQUENCE><![CDATA[Y]]></ISAUTOSEQUENCE>
 <!--1000038 INCREMENTNO-->
@@ -4737,9 +4737,9 @@
 <!--1000129 UPDATEDBY-->
 <!--1000129-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--1000129 NAME-->
-<!--1000129-->              <NAME><![CDATA[DocumentNo_RV_BPartner]]></NAME>
+<!--1000129-->              <NAME><![CDATA[DocumentNo_C_BPartner_V]]></NAME>
 <!--1000129 DESCRIPTION-->
-<!--1000129-->              <DESCRIPTION><![CDATA[DocumentNo/Value for Table RV_BPartner]]></DESCRIPTION>
+<!--1000129-->              <DESCRIPTION><![CDATA[DocumentNo/Value for Table C_BPartner_V]]></DESCRIPTION>
 <!--1000129 ISAUTOSEQUENCE-->
 <!--1000129-->              <ISAUTOSEQUENCE><![CDATA[Y]]></ISAUTOSEQUENCE>
 <!--1000129 INCREMENTNO-->
@@ -5033,9 +5033,9 @@
 <!--1000137 UPDATEDBY-->
 <!--1000137-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--1000137 NAME-->
-<!--1000137-->              <NAME><![CDATA[DocumentNo_RV_C_Invoice]]></NAME>
+<!--1000137-->              <NAME><![CDATA[DocumentNo_C_Invoice_V2]]></NAME>
 <!--1000137 DESCRIPTION-->
-<!--1000137-->              <DESCRIPTION><![CDATA[DocumentNo/Value for Table RV_C_Invoice]]></DESCRIPTION>
+<!--1000137-->              <DESCRIPTION><![CDATA[DocumentNo/Value for Table C_Invoice_V2]]></DESCRIPTION>
 <!--1000137 ISAUTOSEQUENCE-->
 <!--1000137-->              <ISAUTOSEQUENCE><![CDATA[Y]]></ISAUTOSEQUENCE>
 <!--1000137 INCREMENTNO-->
@@ -5070,9 +5070,9 @@
 <!--1000138 UPDATEDBY-->
 <!--1000138-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--1000138 NAME-->
-<!--1000138-->              <NAME><![CDATA[DocumentNo_RV_M_Transaction]]></NAME>
+<!--1000138-->              <NAME><![CDATA[DocumentNo_M_Transaction_V]]></NAME>
 <!--1000138 DESCRIPTION-->
-<!--1000138-->              <DESCRIPTION><![CDATA[DocumentNo/Value for Table RV_M_Transaction]]></DESCRIPTION>
+<!--1000138-->              <DESCRIPTION><![CDATA[DocumentNo/Value for Table M_Transaction_V]]></DESCRIPTION>
 <!--1000138 ISAUTOSEQUENCE-->
 <!--1000138-->              <ISAUTOSEQUENCE><![CDATA[Y]]></ISAUTOSEQUENCE>
 <!--1000138 INCREMENTNO-->
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Oct 09 10:46:11 2008 +0000
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -47786,33 +47786,6 @@
 <!--800774-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--800774**************--></AD_ELEMENT>
 
-<!--800775**************--><AD_ELEMENT>
-<!--800775 AD_ELEMENT_ID-->
-<!--800775-->              <AD_ELEMENT_ID><![CDATA[800775]]></AD_ELEMENT_ID>
-<!--800775 AD_CLIENT_ID-->
-<!--800775-->              <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--800775 AD_ORG_ID-->
-<!--800775-->              <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--800775 ISACTIVE-->
-<!--800775-->              <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--800775 CREATED-->
-<!--800775-->              <CREATED><![CDATA[2007-02-20 16:46:32.0]]></CREATED>
-<!--800775 CREATEDBY-->
-<!--800775-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
-<!--800775 UPDATED-->
-<!--800775-->              <UPDATED><![CDATA[2007-02-20 16:46:32.0]]></UPDATED>
-<!--800775 UPDATEDBY-->
-<!--800775-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
-<!--800775 COLUMNNAME-->
-<!--800775-->              <COLUMNNAME><![CDATA[C_Nation_ID]]></COLUMNNAME>
-<!--800775 NAME-->
-<!--800775-->              <NAME><![CDATA[C_Nation_ID]]></NAME>
-<!--800775 PRINTNAME-->
-<!--800775-->              <PRINTNAME><![CDATA[C_Nation_ID]]></PRINTNAME>
-<!--800775 AD_MODULE_ID-->
-<!--800775-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--800775**************--></AD_ELEMENT>
-
 <!--800776**************--><AD_ELEMENT>
 <!--800776 AD_ELEMENT_ID-->
 <!--800776-->              <AD_ELEMENT_ID><![CDATA[800776]]></AD_ELEMENT_ID>
--- a/src-db/database/sourcedata/AD_PROCESS.xml	Thu Oct 09 10:46:11 2008 +0000
+++ b/src-db/database/sourcedata/AD_PROCESS.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -868,7 +868,7 @@
 <!--121 UPDATEDBY-->
 <!--121-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--121 VALUE-->
-<!--121-->              <VALUE><![CDATA[RV_Order_Open]]></VALUE>
+<!--121-->              <VALUE><![CDATA[C_Order_Open]]></VALUE>
 <!--121 NAME-->
 <!--121-->              <NAME><![CDATA[Open Orders]]></NAME>
 <!--121 DESCRIPTION-->
@@ -995,7 +995,7 @@
 <!--124 UPDATEDBY-->
 <!--124-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--124 VALUE-->
-<!--124-->              <VALUE><![CDATA[RV_M_Transaction_Sum]]></VALUE>
+<!--124-->              <VALUE><![CDATA[M_Transaction_Sum]]></VALUE>
 <!--124 NAME-->
 <!--124-->              <NAME><![CDATA[Product Transaction Summary]]></NAME>
 <!--124 DESCRIPTION-->
@@ -1122,7 +1122,7 @@
 <!--127 UPDATEDBY-->
 <!--127-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--127 VALUE-->
-<!--127-->              <VALUE><![CDATA[RV_C_Invoice_Acct]]></VALUE>
+<!--127-->              <VALUE><![CDATA[C_Invoice_Acct]]></VALUE>
 <!--127 NAME-->
 <!--127-->              <NAME><![CDATA[Invoice Transactions]]></NAME>
 <!--127 DESCRIPTION-->
@@ -1163,7 +1163,7 @@
 <!--128 UPDATEDBY-->
 <!--128-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--128 VALUE-->
-<!--128-->              <VALUE><![CDATA[RV_C_Invoice_Day]]></VALUE>
+<!--128-->              <VALUE><![CDATA[C_Invoice_Day]]></VALUE>
 <!--128 NAME-->
 <!--128-->              <NAME><![CDATA[Daily Invoice]]></NAME>
 <!--128 DESCRIPTION-->
@@ -1204,7 +1204,7 @@
 <!--129 UPDATEDBY-->
 <!--129-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--129 VALUE-->
-<!--129-->              <VALUE><![CDATA[RV_C_Invoice_Month]]></VALUE>
+<!--129-->              <VALUE><![CDATA[C_Invoice_Month]]></VALUE>
 <!--129 NAME-->
 <!--129-->              <NAME><![CDATA[Monthly Invoice]]></NAME>
 <!--129 DESCRIPTION-->
@@ -1245,7 +1245,7 @@
 <!--130 UPDATEDBY-->
 <!--130-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--130 VALUE-->
-<!--130-->              <VALUE><![CDATA[RV_C_Invoice_Week]]></VALUE>
+<!--130-->              <VALUE><![CDATA[C_Invoice_Week]]></VALUE>
 <!--130 NAME-->
 <!--130-->              <NAME><![CDATA[Weekly Invoice]]></NAME>
 <!--130 DESCRIPTION-->
@@ -1286,7 +1286,7 @@
 <!--131 UPDATEDBY-->
 <!--131-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--131 VALUE-->
-<!--131-->              <VALUE><![CDATA[RV_C_Invoice_ProdWeek]]></VALUE>
+<!--131-->              <VALUE><![CDATA[C_Invoice_ProdWeek]]></VALUE>
 <!--131 NAME-->
 <!--131-->              <NAME><![CDATA[Weekly Product Invoice]]></NAME>
 <!--131 DESCRIPTION-->
@@ -1327,7 +1327,7 @@
 <!--132 UPDATEDBY-->
 <!--132-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--132 VALUE-->
-<!--132-->              <VALUE><![CDATA[RV_C_Invoice_ProdMonth]]></VALUE>
+<!--132-->              <VALUE><![CDATA[C_Invoice_ProdMonth]]></VALUE>
 <!--132 NAME-->
 <!--132-->              <NAME><![CDATA[Monthly Product Invoice]]></NAME>
 <!--132 DESCRIPTION-->
@@ -1368,7 +1368,7 @@
 <!--133 UPDATEDBY-->
 <!--133-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--133 VALUE-->
-<!--133-->              <VALUE><![CDATA[RV_C_Invoice_VendorMonth]]></VALUE>
+<!--133-->              <VALUE><![CDATA[C_Invoice_VendorMonth]]></VALUE>
 <!--133 NAME-->
 <!--133-->              <NAME><![CDATA[Monthly Vendor Invoice Report]]></NAME>
 <!--133 DESCRIPTION-->
@@ -1581,7 +1581,7 @@
 <!--138 UPDATEDBY-->
 <!--138-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--138 VALUE-->
-<!--138-->              <VALUE><![CDATA[RV_C_Invoice_CustomerProdQtr]]></VALUE>
+<!--138-->              <VALUE><![CDATA[C_Invoice_CustomerProdQtr]]></VALUE>
 <!--138 NAME-->
 <!--138-->              <NAME><![CDATA[Quarterly Customer Invoice by Product]]></NAME>
 <!--138 DESCRIPTION-->
@@ -1622,7 +1622,7 @@
 <!--139 UPDATEDBY-->
 <!--139-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--139 VALUE-->
-<!--139-->              <VALUE><![CDATA[RV_C_Invoice_CustomerVendQtr]]></VALUE>
+<!--139-->              <VALUE><![CDATA[C_Invoice_CustomerVendQtr]]></VALUE>
 <!--139 NAME-->
 <!--139-->              <NAME><![CDATA[Quarterly Customer Invoice by Vendor]]></NAME>
 <!--139 DESCRIPTION-->
@@ -1835,7 +1835,7 @@
 <!--151 UPDATEDBY-->
 <!--151-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--151 VALUE-->
-<!--151-->              <VALUE><![CDATA[RV_C_Invoice]]></VALUE>
+<!--151-->              <VALUE><![CDATA[C_Invoice_V2]]></VALUE>
 <!--151 NAME-->
 <!--151-->              <NAME><![CDATA[Invoice Summary]]></NAME>
 <!--151 DESCRIPTION-->
@@ -1876,7 +1876,7 @@
 <!--152 UPDATEDBY-->
 <!--152-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--152 VALUE-->
-<!--152-->              <VALUE><![CDATA[RV_C_InvoiceLine]]></VALUE>
+<!--152-->              <VALUE><![CDATA[C_InvoiceLine_V2]]></VALUE>
 <!--152 NAME-->
 <!--152-->              <NAME><![CDATA[Invoice Detail - old]]></NAME>
 <!--152 DESCRIPTION-->
@@ -2175,7 +2175,7 @@
 <!--161 UPDATEDBY-->
 <!--161-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--161 VALUE-->
-<!--161-->              <VALUE><![CDATA[RV_M_Transaction]]></VALUE>
+<!--161-->              <VALUE><![CDATA[M_Transaction_V]]></VALUE>
 <!--161 NAME-->
 <!--161-->              <NAME><![CDATA[Product Transaction Value]]></NAME>
 <!--161 DESCRIPTION-->
@@ -2517,7 +2517,7 @@
 <!--170 UPDATEDBY-->
 <!--170-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--170 VALUE-->
-<!--170-->              <VALUE><![CDATA[RV_Cash_Detail]]></VALUE>
+<!--170-->              <VALUE><![CDATA[C_Cash_Detail]]></VALUE>
 <!--170 NAME-->
 <!--170-->              <NAME><![CDATA[Cash Journal Detail]]></NAME>
 <!--170 DESCRIPTION-->
--- a/src-db/database/sourcedata/AD_TABLE.xml	Thu Oct 09 10:46:11 2008 +0000
+++ b/src-db/database/sourcedata/AD_TABLE.xml	Thu Oct 09 12:06:24 2008 +0000
@@ -6822,9 +6822,9 @@
 <!--360 UPDATEDBY-->
 <!--360-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--360 NAME-->
-<!--360-->              <NAME><![CDATA[RV_Order_Open]]></NAME>
+<!--360-->              <NAME><![CDATA[C_Order_Open]]></NAME>
 <!--360 TABLENAME-->
-<!--360-->              <TABLENAME><![CDATA[RV_Order_Open]]></TABLENAME>
+<!--360-->              <TABLENAME><![CDATA[C_Order_Open]]></TABLENAME>
 <!--360 ISVIEW-->
 <!--360-->              <ISVIEW><![CDATA[Y]]></ISVIEW>
 <!--360 ACCESSLEVEL-->
@@ -6865,9 +6865,9 @@
 <!--363 UPDATEDBY-->
 <!--363-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--363 NAME-->
-<!--363-->              <NAME><![CDATA[RV_M_Transaction_Sum]]></NAME>
+<!--363-->              <NAME><![CDATA[M_Transaction_Sum]]></NAME>
 <!--363 TABLENAME-->
-<!--363-->              <TABLENAME><![CDATA[RV_M_Transaction_Sum]]></TABLENAME>
+<!--363-->              <TABLENAME><![CDATA[M_Transaction_Sum]]></TABLENAME>
 <!--363 ISVIEW-->
 <!--363-->              <ISVIEW><![CDATA[Y]]></ISVIEW>
 <!--363 ACCESSLEVEL-->
@@ -6994,9 +6994,9 @@
 <!--369 UPDATEDBY-->
 <!--369-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--369 NAME-->
-<!--369-->              <NAME><![CDATA[RV_C_Invoice_Day]]></NAME>
+<!--369-->              <NAME><![CDATA[C_Invoice_Day]]></NAME>
 <!--369 TABLENAME-->
-<!--369-->              <TABLENAME><![CDATA[RV_C_Invoice_Day]]></TABLENAME>
+<!--369-->              <TABLENAME><![CDATA[C_Invoice_Day]]></TABLENAME>
 <!--369 ISVIEW-->
 <!--369-->              <ISVIEW><![CDATA[Y]]></ISVIEW>
 <!--369 ACCESSLEVEL-->
@@ -7037,9 +7037,9 @@
 <!--370 UPDATEDBY-->
 <!--370-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--370 NAME-->
-<!--370-->              <NAME><![CDATA[RV_C_Invoice_Month]]></NAME>
+<!--370-->              <NAME><![CDATA[C_Invoice_Month]]></NAME>
 <!--370 TABLENAME-->
-<!--370-->              <TABLENAME><![CDATA[RV_C_Invoice_Month]]></TABLENAME>
+<!--370-->              <TABLENAME><![CDATA[C_Invoice_Month]]></TABLENAME>
 <!--370 ISVIEW-->
 <!--370-->              <ISVIEW><![CDATA[Y]]></ISVIEW>
 <!--370 ACCESSLEVEL-->
@@ -7080,9 +7080,9 @@
 <!--371 UPDATEDBY-->
 <!--371-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--371 NAME-->
-<!--371-->              <NAME><![CDATA[RV_C_Invoice_ProdMonth]]></NAME>
+<!--371-->              <NAME><![CDATA[C_Invoice_ProdMonth]]></NAME>
 <!--371 TABLENAME-->
-<!--371-->              <TABLENAME><![CDATA[RV_C_Invoice_ProdMonth]]></TABLENAME>
+<!--371-->              <TABLENAME><![CDATA[C_Invoice_ProdMonth]]></TABLENAME>
 <!--371 ISVIEW-->
 <!--371-->              <ISVIEW><![CDATA[Y]]></ISVIEW>
 <!--371 ACCESSLEVEL-->
@@ -7123,9 +7123,9 @@
 <!--372 UPDATEDBY-->
 <!--372-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--372 NAME-->
-<!--372-->              <NAME><![CDATA[RV_C_Invoice_ProdWeek]]></NAME>
+<!--372-->              <NAME><![CDATA[C_Invoice_ProdWeek]]></NAME>
 <!--372 TABLENAME-->
-<!--372-->              <TABLENAME><![CDATA[RV_C_Invoice_ProdWeek]]></TABLENAME>
+<!--372-->              <TABLENAME><![CDATA[C_Invoice_ProdWeek]]></TABLENAME>
 <!--372 ISVIEW-->
 <!--372-->              <ISVIEW><![CDATA[Y]]></ISVIEW>
 <!--372 ACCESSLEVEL-->
@@ -7166,9 +7166,9 @@
 <!--373 UPDATEDBY-->
 <!--373-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--373 NAME-->
-<!--373-->              <NAME><![CDATA[RV_C_Invoice_VendorMonth]]></NAME>
+<!--373-->              <NAME><![CDATA[C_Invoice_VendorMonth]]></NAME>
 <!--373 TABLENAME-->
-<!--373-->              <TABLENAME><![CDATA[RV_C_Invoice_VendorMonth]]></TABLENAME>
+<!--373-->              <TABLENAME><![CDATA[C_Invoice_VendorMonth]]></TABLENAME>
 <!--373 ISVIEW-->
 <!--373-->              <ISVIEW><![CDATA[Y]]></ISVIEW>
 <!--373 ACCESSLEVEL-->
@@ -7209,9 +7209,9 @@
 <!--374 UPDATEDBY-->
 <!--374-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--374 NAME-->
-<!--374-->              <NAME><![CDATA[RV_C_Invoice_Week]]></NAME>
+<!--374-->              <NAME><![CDATA[C_Invoice_Week]]></NAME>
 <!--374 TABLENAME-->
-<!--374-->              <TABLENAME><![CDATA[RV_C_Invoice_Week]]></TABLENAME>
+<!--374-->              <TABLENAME><![CDATA[C_Invoice_Week]]></TABLENAME>
 <!--374 ISVIEW-->
 <!--374-->              <ISVIEW><![CDATA[Y]]></ISVIEW>
 <!--374 ACCESSLEVEL-->
@@ -7608,9 +7608,9 @@
 <!--387 UPDATEDBY-->
 <!--387-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--387 NAME-->
-<!--387-->              <NAME><![CDATA[RV_C_Invoice_CustomerProdQtr]]></NAME>
+<!--387-->              <NAME><![CDATA[C_Invoice_CustomerProdQtr]]></NAME>
 <!--387 TABLENAME-->
-<!--387-->              <TABLENAME><![CDATA[RV_C_Invoice_CustomerProdQtr]]></TABLENAME>
+<!--387-->              <TABLENAME><![CDATA[C_Invoice_CustomerProdQtr]]></TABLENAME>
 <!--387 ISVIEW-->
 <!--387-->              <ISVIEW><![CDATA[Y]]></ISVIEW>
 <!--387 ACCESSLEVEL-->
@@ -7651,9 +7651,9 @@
 <!--388 UPDATEDBY-->
 <!--388-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--388 NAME-->
-<!--388-->              <NAME><![CDATA[RV_C_Invoice_CustomerVendQtr]]></NAME>
+<!--388-->              <NAME><![CDATA[C_Invoice_CustomerVendQtr]]></NAME>
 <!--388 TABLENAME-->
-<!--388-->              <TABLENAME><![CDATA[RV_C_Invoice_CustomerVendQtr]]></TABLENAME>
+<!--388-->              <TABLENAME><![CDATA[C_Invoice_CustomerVendQtr]]></TABLENAME>
 <!--388 ISVIEW-->
 <!--388-->              <ISVIEW><![CDATA[Y]]></ISVIEW>
 <!--388 ACCESSLEVEL-->
@@ -8780,9 +8780,9 @@
 <!--423 UPDATEDBY-->
 <!--423-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--423 NAME-->
-<!--423-->              <NAME><![CDATA[RV_C_Invoice]]></NAME>
+<!--423-->              <NAME><![CDATA[C_Invoice_V2]]></NAME>
 <!--423 TABLENAME-->
-<!--423-->              <TABLENAME><![CDATA[RV_C_Invoice]]></TABLENAME>
+<!--423-->              <TABLENAME><![CDATA[C_Invoice_V2]]></TABLENAME>
 <!--423 ISVIEW-->
 <!--423-->              <ISVIEW><![CDATA[Y]]></ISVIEW>
 <!--423 ACCESSLEVEL-->
@@ -8823,9 +8823,9 @@
 <!--424 UPDATEDBY-->
 <!--424-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--424 NAME-->
-<!--424-->              <NAME><![CDATA[RV_C_InvoiceLine]]></NAME>
+<!--424-->              <NAME><![CDATA[C_InvoiceLine_V2]]></NAME>
 <!--424 TABLENAME-->
-<!--424-->              <TABLENAME><![CDATA[RV_C_InvoiceLine]]></TABLENAME>
+<!--424-->              <TABLENAME><![CDATA[C_InvoiceLine_V2]]></TABLENAME>
 <!--424 ISVIEW-->
 <!--424-->              <ISVIEW><![CDATA[Y]]></ISVIEW>
 <!--424 ACCESSLEVEL-->
@@ -8866,9 +8866,9 @@
 <!--425 UPDATEDBY-->
 <!--425-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--425 NAME-->
-<!--425-->              <NAME><![CDATA[RV_M_Transaction]]></NAME>
+<!--425-->              <NAME><![CDATA[M_Transaction_V]]></NAME>
 <!--425 TABLENAME-->
-<!--425-->              <TABLENAME><![CDATA[RV_M_Transaction]]></TABLENAME>
+<!--425-->              <TABLENAME><![CDATA[M_Transaction_V]]></TABLENAME>
 <!--425 ISVIEW-->
 <!--425-->              <ISVIEW><![CDATA[Y]]></ISVIEW>
 <!--425 ACCESSLEVEL-->
@@ -9534,9 +9534,9 @@
 <!--471 UPDATEDBY-->
 <!--471-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--471 NAME-->
-<!--471-->              <NAME><![CDATA[RV_Cash_Detail]]></NAME>
+<!--471-->              <NAME><![CDATA[C_Cash_Detail]]></NAME>
 <!--471 TABLENAME-->
-<!--471-->              <TABLENAME><![CDATA[RV_Cash_Detail]]></TABLENAME>
+<!--471-->              <TABLENAME><![CDATA[C_Cash_Detail]]></TABLENAME>
 <!--471 ISVIEW-->
 <!--471-->              <ISVIEW><![CDATA[Y]]></ISVIEW>
 <!--471 ACCESSLEVEL-->
@@ -10419,9 +10419,9 @@
 <!--520 UPDATEDBY-->
 <!--520-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
 <!--520 NAME-->
-<!--520-->              <NAME><![CDATA[RV_BPartner]]></NAME>
+<!--520-->              <NAME><![CDATA[C_BPartner_V]]></NAME>
 <!--520 TABLENAME-->
-<!--520-->              <TABLENAME><![CDATA[RV_BPartner]]></TABLENAME>
+<!--520-->              <TABLENAME><![CDATA[C_BPartner_V]]></TABLENAME>
 <!--520 ISVIEW-->
 <!--520-->              <ISVIEW><![CDATA[Y]]></ISVIEW>
 <!--520 ACCESSLEVEL-->
@@ -13920,9 +13920,9 @@
 <!--800025 UPDATEDBY-->
 <!--800025-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--800025 NAME-->
-<!--800025-->              <NAME><![CDATA[Report_Projectproposal]]></NAME>
+<!--800025-->              <NAME><![CDATA[C_Projectproposal_V]]></NAME>
 <!--800025 TABLENAME-->
-<!--800025-->              <TABLENAME><![CDATA[Report_Projectproposal]]></TABLENAME>
+<!--800025-->              <TABLENAME><![CDATA[C_Projectproposal_V]]></TABLENAME>
 <!--800025 ISVIEW-->
 <!--800025-->              <ISVIEW><![CDATA[Y]]></ISVIEW>
 <!--800025 ACCESSLEVEL-->
@@ -13942,7 +13942,7 @@
 <!--800025 ISDEFAULTACCT-->
 <!--800025-->              <ISDEFAULTACCT><![CDATA[N]]></ISDEFAULTACCT>
 <!--800025 SQL_RECORD_IDENTIFIER-->
-<!--800025-->              <SQL_RECORD_IDENTIFIER><![CDATA[SELECT (SELECT TO_CHAR(COALESCE(TO_CHAR(TT.Value),''))||' - '||TO_CHAR(COALESCE(TO_CHAR(TT.Name),'')) FROM C_Project TT WHERE TT.C_Project_ID=T.C_Project_ID) ||' - '||TO_CHAR(COALESCE(TO_CHAR(T.Firstname),''))||' - '||TO_CHAR(COALESCE(TO_CHAR(T.Lastname),'')) AS COLUMN_IDENTIFIER FROM (SELECT AD_LANGUAGE FROM AD_LANGUAGE WHERE AD_LANGUAGE=:c_language) L, Report_Projectproposal T WHERE C_Projectproposal_ID=':c_ID']]></SQL_RECORD_IDENTIFIER>
+<!--800025-->              <SQL_RECORD_IDENTIFIER><![CDATA[SELECT (SELECT TO_CHAR(COALESCE(TO_CHAR(TT.Value),''))||' - '||TO_CHAR(COALESCE(TO_CHAR(TT.Name),'')) FROM C_Project TT WHERE TT.C_Project_ID=T.C_Project_ID) ||' - '||TO_CHAR(COALESCE(TO_CHAR(T.Firstname),''))||' - '||TO_CHAR(COALESCE(TO_CHAR(T.Lastname),'')) AS COLUMN_IDENTIFIER FROM (SELECT AD_LANGUAGE FROM AD_LANGUAGE WHERE AD_LANGUAGE=:c_language) L, C_Projectproposal_V T WHERE C_Projectproposal_ID=':c_ID']]></SQL_RECORD_IDENTIFIER>
 <!--800025 DEVELOPMENTSTATUS-->
 <!--800025-->              <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--800025 AD_MODULE_ID-->
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoicesEditJR.jrxml	Thu Oct 09 10:46:11 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoicesEditJR.jrxml	Thu Oct 09 12:06:24 2008 +0000
@@ -199,7 +199,7 @@
       IL.QTYINVOICED AS QTYINVOICED, TO_CHAR(C_UOM.UOMSYMBOL) AS UOMSYMBOL,IL.PRICEACTUAL AS PRICEACTUAL, C_TAX.RATE AS TAX, IL.LINENETAMT AS LINENETAMT,
       NULL AS BASE
       FROM C_INVOICE I left join C_ORDER O on I.C_ORDER_ID = O.C_ORDER_ID
-                       right join RV_C_INVOICELINE IL on IL.C_INVOICE_ID = I.C_INVOICE_ID,
+                       right join C_INVOICELINE_V2 IL on IL.C_INVOICE_ID = I.C_INVOICE_ID,
            C_BPARTNER B, M_PRODUCT P, C_UOM, C_INVOICELINE, C_TAX
       WHERE IL.M_PRODUCT_ID = P.M_PRODUCT_ID
       AND IL.C_BPARTNER_ID = B.C_BPARTNER_ID
@@ -211,7 +211,7 @@
       SELECT B.NAME AS NAMEBPARTNER, I2.C_INVOICE_ID AS INVOICEID, I2.DOCUMENTNO AS INVOICEDOCUMENTNO, O.DOCUMENTNO AS DOCNOORDER, I2.DESCRIPTION AS DESCRIPTIONINVOICE, I2.DATEINVOICED AS DATEINVOICED,
       NULL AS LINE , C_TAX.NAME AS NAMEPRODUCT,
       NULL AS QTYINVOICED, '' AS UOMSYMBOL, NULL AS PRICEACTUAL, NULL AS TAX, C_INVOICETAX.TAXAMT AS LINENETAMT, C_INVOICETAX.TAXBASEAMT AS BASE
-      FROM C_INVOICE I2 left join RV_C_INVOICELINE IL on IL.C_INVOICE_ID = I2.C_INVOICE_ID
+      FROM C_INVOICE I2 left join C_INVOICELINE_V2 IL on IL.C_INVOICE_ID = I2.C_INVOICE_ID
                         left join C_ORDER O           on I2.C_ORDER_ID = O.C_ORDER_ID,
        C_BPARTNER B, M_PRODUCT P, C_TAX, C_INVOICETAX
       WHERE IL.M_PRODUCT_ID = P.M_PRODUCT_ID
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoices_data.xsql	Thu Oct 09 10:46:11 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoices_data.xsql	Thu Oct 09 12:06:24 2008 +0000
@@ -36,7 +36,7 @@
       IL.QTYINVOICED AS QTYINVOICED, TO_CHAR(C_UOM.UOMSYMBOL) AS UOMSYMBOL,IL.PRICEACTUAL AS PRICEACTUAL, C_TAX.RATE AS TAX, IL.LINENETAMT AS LINENETAMT,
       NULL AS BASE
       FROM C_INVOICE I left join C_ORDER O on I.C_ORDER_ID = O.C_ORDER_ID
-                       right join RV_C_INVOICELINE IL on IL.C_INVOICE_ID = I.C_INVOICE_ID,
+                       right join C_INVOICELINE_V2 IL on IL.C_INVOICE_ID = I.C_INVOICE_ID,
            C_BPARTNER B, M_PRODUCT P, C_UOM, C_INVOICELINE, C_TAX
       WHERE IL.M_PRODUCT_ID = P.M_PRODUCT_ID
       AND IL.C_BPARTNER_ID = B.C_BPARTNER_ID
@@ -50,7 +50,7 @@
       SELECT B.NAME AS NAMEBPARTNER, I2.C_INVOICE_ID AS INVOICEID, I2.DOCUMENTNO AS INVOICEDOCUMENTNO, O.DOCUMENTNO AS DOCNOORDER, I2.DESCRIPTION AS DESCRIPTIONINVOICE, I2.DATEINVOICED AS DATEINVOICED,
       NULL AS LINE , C_TAX.NAME AS NAMEPRODUCT,
       NULL AS QTYINVOICED, '' AS UOMSYMBOL, NULL AS PRICEACTUAL, NULL AS TAX, C_INVOICETAX.TAXAMT AS LINENETAMT, C_INVOICETAX.TAXBASEAMT AS BASE
-      FROM C_INVOICE I2 left join RV_C_INVOICELINE IL on IL.C_INVOICE_ID = I2.C_INVOICE_ID
+      FROM C_INVOICE I2 left join C_INVOICELINE_V2 IL on IL.C_INVOICE_ID = I2.C_INVOICE_ID
                         left join C_ORDER O           on I2.C_ORDER_ID = O.C_ORDER_ID,
        C_BPARTNER B, M_PRODUCT P, C_TAX, C_INVOICETAX
       WHERE IL.M_PRODUCT_ID = P.M_PRODUCT_ID