details:   https://code.openbravo.com/erp/devel/pi/rev/ba7850bc2648
changeset: 19079:ba7850bc2648
user:      Gorka Ion Damián <gorkaion.damian <at> openbravo.com>
date:      Wed Dec 19 12:22:13 2012 +0100
summary:   Fixed issue 22634.Fix pg database consistency issue in view.

diffstat:

 src-db/database/model/views/M_PRERESERVATION_PICK_EDIT.xml |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (9 lines):

diff -r bf1cabd2bc65 -r ba7850bc2648 
src-db/database/model/views/M_PRERESERVATION_PICK_EDIT.xml
--- a/src-db/database/model/views/M_PRERESERVATION_PICK_EDIT.xml        Wed Dec 
19 10:07:13 2012 +0100
+++ b/src-db/database/model/views/M_PRERESERVATION_PICK_EDIT.xml        Wed Dec 
19 12:22:13 2012 +0100
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW M_PRERESERVATION_PICK_EDIT">
-    <view name="M_PRERESERVATION_PICK_EDIT"><![CDATA[SELECT 
COALESCE(res.m_reservation_stock_id, (sol.c_orderline_id || 
pol.c_orderline_id)) AS m_prereservation_pick_edit_id, pol.ad_client_id, 
pol.ad_org_id, pol.createdby, pol.created, pol.updated, pol.updatedby, 
to_char('Y') AS isactive, pol.c_orderline_id AS purchase_orderline_id, 
sol.c_orderline_id AS sales_orderline_id, so.documentno, sol.line, 
so.dateordered, so.datepromised, pol.qtyordered AS purchasedqty, del.qty AS 
receivedqty, res.quantity AS reservedqty, res.m_reservation_stock_id, CASE WHEN 
res.m_reservation_stock_id IS NULL THEN 'N' ELSE 'Y' END AS ob_selected, 
sol.qtyordered, sol.qtydelivered, solres.m_reservation_id, COALESCE(solres.qty, 
0) - COALESCE(res.quantity, 0) AS otherresqty, so.c_bpartner_id FROM 
c_orderline pol JOIN c_order po ON pol.c_order_id = po.c_order_id AND 
po.issotrx = 'N' AND po.docstatus = 'CO' JOIN c_orderline sol ON 
pol.m_product_id = sol.m_product_id AND sol.qtyordered <> sol.qtydelivered JOIN 
c_order so ON sol.c_order_id = so.c_order_id AND so.issotrx = 'Y' AND 
so.docstatus = 'CO' JOIN (SELECT COALESCE(sum(mp.qty), 0) AS qty, 
ol.c_orderline_id FROM c_orderline ol JOIN c_order o ON ol.c_order_id = 
o.c_order_id AND o.issotrx = 'N' AND o.docstatus = 'CO' LEFT JOIN m_matchpo mp 
ON mp.c_orderline_id = ol.c_orderline_id AND mp.m_inoutline_id IS NOT NULL 
GROUP BY ol.c_orderline_id) del ON del.c_orderline_id = pol.c_orderline_id AND 
del.qty <> pol.qtyordered LEFT JOIN (SELECT r.c_orderline_id AS 
sales_orderline_id, rs.c_orderline_id AS purchase_orderline_id, rs.quantity, 
rs.m_reservation_stock_id FROM m_reservation r JOIN m_reservation_stock rs ON 
r.m_reservation_id = rs.m_reservation_id WHERE r.c_orderline_id IS NOT NULL AND 
rs.c_orderline_id IS NOT NULL AND rs.m_locator_id IS NULL AND (r.res_status != 
'CL')) res ON res.sales_orderline_id = sol.c_orderline_id AND 
res.purchase_orderline_id = pol.c_orderline_id LEFT JOIN (SELECT 
sum(rs.quantity - COALESCE(rs.releasedqty, 0)) AS qty, r.m_reservation_id, 
r.c_orderline_id, r.quantity AS resqty FROM m_reservation r JOIN 
m_reservation_stock rs ON r.m_reservation_id = rs.m_reservation_id WHERE 
r.c_orderline_id IS NOT NULL GROUP BY r.m_reservation_id, r.c_orderline_id, 
r.quantity) solres ON solres.c_orderline_id = sol.c_orderline_id WHERE 
(COALESCE(solres.qty, 0) - COALESCE(res.quantity, 0)) <> (sol.qtyordered - 
sol.qtydelivered)]]></view>
+    <view name="M_PRERESERVATION_PICK_EDIT"><![CDATA[SELECT 
COALESCE(res.m_reservation_stock_id, (sol.c_orderline_id || 
pol.c_orderline_id)) AS m_prereservation_pick_edit_id, pol.ad_client_id, 
pol.ad_org_id, pol.createdby, pol.created, pol.updated, pol.updatedby, 
to_char('Y') AS isactive, pol.c_orderline_id AS purchase_orderline_id, 
sol.c_orderline_id AS sales_orderline_id, so.documentno, sol.line, 
so.dateordered, so.datepromised, pol.qtyordered AS purchasedqty, del.qty AS 
receivedqty, res.quantity AS reservedqty, res.m_reservation_stock_id,  CASE 
WHEN res.m_reservation_stock_id IS NULL THEN 'N' ELSE 'Y' END AS ob_selected, 
sol.qtyordered, sol.qtydelivered, solres.m_reservation_id, COALESCE(solres.qty, 
0) - COALESCE(res.quantity, 0) AS otherresqty, so.c_bpartner_id FROM 
c_orderline pol JOIN c_order po ON pol.c_order_id = po.c_order_id AND 
po.issotrx = 'N' AND po.docstatus = 'CO' JOIN c_orderline sol ON 
pol.m_product_id = sol.m_product_id AND sol.qtyordered <> sol.qtydelivered JOIN 
c_order so ON sol.c_order_id = so.c_order_id AND so.issotrx = 'Y' AND 
so.docstatus = 'CO' JOIN (SELECT COALESCE(sum(mp.qty), 0) AS qty, 
ol.c_orderline_id FROM c_orderline ol JOIN c_order o ON ol.c_order_id = 
o.c_order_id AND o.issotrx = 'N' AND o.docstatus = 'CO' LEFT JOIN m_matchpo mp 
ON mp.c_orderline_id = ol.c_orderline_id AND mp.m_inoutline_id IS NOT NULL 
GROUP BY ol.c_orderline_id) del ON del.c_orderline_id = pol.c_orderline_id AND 
del.qty <> pol.qtyordered LEFT JOIN (SELECT r.c_orderline_id AS 
sales_orderline_id, rs.c_orderline_id AS purchase_orderline_id, rs.quantity, 
rs.m_reservation_stock_id FROM m_reservation r JOIN m_reservation_stock rs ON 
r.m_reservation_id = rs.m_reservation_id WHERE r.c_orderline_id IS NOT NULL AND 
rs.c_orderline_id IS NOT NULL AND rs.m_locator_id IS NULL AND r.res_status <> 
'CL') res ON res.sales_orderline_id = sol.c_orderline_id AND 
res.purchase_orderline_id = pol.c_orderline_id LEFT JOIN (SELECT 
sum(rs.quantity - COALESCE(rs.releasedqty, 0)) AS qty, r.m_reservation_id, 
r.c_orderline_id, r.quantity AS resqty FROM m_reservation r JOIN 
m_reservation_stock rs ON r.m_reservation_id = rs.m_reservation_id WHERE 
r.c_orderline_id IS NOT NULL GROUP BY r.m_reservation_id, r.c_orderline_id, 
r.quantity) solres ON solres.c_orderline_id = sol.c_orderline_id WHERE 
(COALESCE(solres.qty, 0) - COALESCE(res.quantity, 0)) <> (sol.qtyordered - 
sol.qtydelivered)]]></view>
   </database>

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to