Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0007528
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 03. Procurement managementmajoralways2009-02-12 13:452009-03-18 11:02
ReporternetworkbView Statuspublic 
Assigned ToAinhoaPagola 
PriorityimmediateResolutionfixedFixed in Version2.50beta
StatusclosedFix in branchpiFixed in SCM revision13134
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product Version2.40SCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0007528: Requisition to Order process fails if product price is 0

DescriptionIf a requisition is created, and contains a line within a price 0, Requisition to Order process fails. This is the log showed:

SELECT M_REQUISITIONLINE.M_PRODUCT_ID, M_ATTRIBUTESETINSTANCE_ID, LOCKQTY, SUPPLIERNOTES AS DESCRIPTION, C_UOM_ID, M_REQUISITIONLINE_ID, '' AS C_ORDERLINE_ID, COALESCE(M_PRODUCTPRICE.PRICELIST, M_REQUISITIONLINE.PRICELIST, LOCKPRICE) AS PRICELIST, COALESCE(M_PRODUCTPRICE.PRICELIMIT, LOCKPRICE) AS PRICELIMIT, COALESCE(M_PRODUCTPRICE.PRICESTD, LOCKPRICE) AS PRICESTD, ROUND(COALESCE(LOCKPRICE, M_PRODUCTPRICE.PRICESTD),(SELECT PRICEPRECISION FROM C_CURRENCY WHERE C_CURRENCY_ID = to_number(?))) AS PRICEACTUAL, ROUND((COALESCE(M_PRODUCTPRICE.PRICELIST, M_REQUISITIONLINE.PRICELIST, LOCKPRICE) - COALESCE(LOCKPRICE, M_PRODUCTPRICE.PRICESTD))/ COALESCE(M_PRODUCTPRICE.PRICELIST, M_REQUISITIONLINE.PRICELIST, LOCKPRICE)*100, (SELECT STDPRECISION FROM C_CURRENCY WHERE C_CURRENCY_ID = ?)) AS DISCOUNT, C_GetTax(M_REQUISITIONLINE.M_PRODUCT_ID, to_date(?), to_number(?), to_number(?), to_number(?), to_number(?), null, 'N') AS TAX, CASE WHEN LOCKQTY < (M_REQUISITIONLINE.QTY - M_REQUISITIONLINE.ORDEREDQTY) THEN 'N' ELSE 'Y' END AS TO_CLOSE FROM M_REQUISITIONLINE LEFT JOIN M_PRODUCTPRICE ON M_REQUISITIONLINE.M_PRODUCT_ID = M_PRODUCTPRICE.M_PRODUCT_ID AND M_PRODUCTPRICE.M_PRICELIST_VERSION_ID = to_number(?) WHERE 1=1 AND M_RequisitionLine_ID IN('1000000') ORDER BY M_REQUISITIONLINE.M_PRODUCT_ID, M_ATTRIBUTESETINSTANCE_ID, SUPPLIERNOTES, ROUND(COALESCE(LOCKPRICE, M_PRODUCTPRICE.PRICESTD),(SELECT PRICEPRECISION FROM C_CURRENCY WHERE C_CURRENCY_ID = to_number(?)))Exception:java.sql.SQLException: ORA-01476: el divisor es igual a cero
Steps To ReproduceCreate a requisiton
Add a line with a product, and price 0.
Go to Requisition to Order process.
Select this requisition and process it.

Application shows a message like "Process run error".
Tagscommsup_sprint6
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
depends on backport 0007536 closedAinhoaPagola Requisition to Order process fails if product price is 0 

-  Notes
(0013418)
gorkaion (developer)
2009-02-12 15:59

The SQL clause to calculate the discount is wrong.

ROUND((COALESCE(M_PRODUCTPRICE.PRICELIST, M_REQUISITIONLINE.PRICELIST, LOCKPRICE) - COALESCE(LOCKPRICE, M_PRODUCTPRICE.PRICESTD))/ COALESCE(M_PRODUCTPRICE.PRICELIST, M_REQUISITIONLINE.PRICELIST, LOCKPRICE)*100, (SELECT STDPRECISION FROM C_CURRENCY WHERE C_CURRENCY_ID = ?)) AS DISCOUNT

It is needed to include a CASE WHEN clause to set the discount to zero when the prices is 0

CASE WHEN COALESCE(M_PRODUCTPRICE.PRICELIST, M_REQUISITIONLINE.PRICELIST, LOCKPRICE) = 0 THEN 0 ELSE ..... END
(0013450)
svnbot (reporter)
2009-02-13 10:19

Repository: openbravo
Revision: 13134
Author: AinhoaPagola
Date: 2009-02-13 10:19:35 +0100 (Fri, 13 Feb 2009)

Fixes bug 0007528 Requisition to order fixed for product price 0

---
U trunk/src/org/openbravo/erpCommon/ad_forms/RequisitionToOrder_data.xsql
---

https://dev.openbravo.com/websvn/openbravo/?rev=13134&sc=1 [^]

- Issue History
Date Modified Username Field Change
2009-02-12 13:45 networkb New Issue
2009-02-12 13:45 networkb Assigned To => rafaroda
2009-02-12 13:45 networkb Regression testing => No
2009-02-12 15:59 gorkaion Status new => scheduled
2009-02-12 15:59 gorkaion Note Added: 0013418
2009-02-12 15:59 gorkaion fix_in_branch => trunk
2009-02-12 16:00 gorkaion Status scheduled => acknowledged
2009-02-12 16:01 gorkaion Status acknowledged => scheduled
2009-02-12 16:01 gorkaion Assigned To rafaroda => AinhoaPagola
2009-02-13 10:19 svnbot Checkin
2009-02-13 10:19 svnbot Note Added: 0013450
2009-02-13 10:19 svnbot Status scheduled => resolved
2009-02-13 10:19 svnbot Resolution open => fixed
2009-02-13 10:19 svnbot svn_revision => 13134
2009-02-13 10:43 AinhoaPagola Tag Attached: commsup_sprint6
2009-02-20 10:13 sureshbabu Status resolved => closed
2009-02-20 10:13 sureshbabu Fixed in Version => trunk
2009-03-18 11:02 anonymous sf_bug_id 0 => 2691386


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker