|
Reporter wants to have average cost for attribute basis. Currently “Generate Average Cost” process does not include attribute as one of the parameter. They have computed only product basis. If we want to fix it in “Valued Stock Report” (showing different average cost for different attribute), we have to fix it in “Generate Average Cost” process.
Approach 1:
We may not show this report based on the attribute set. It means same product should not repeat again and again (attribute set should not be considered). We have to show single line for any given product. For instance, “Boots” is repeating again and again in the given screen shot. It should not be repeat again and again.
Approach 2:
We can leave “Valued Stock Report” as it is (considering attribute set). But we have to fix it in “Generate Average Cost” process that need to be consider attribute set.
We need to get clarification, since it has business impact. |
|
|
This fix is broken on Oracle:
http://builds.openbravo.com/job/erp_devel_pi-inc-oracle/140/console [^]
[java] 487 [main] INFO org.openbravo.data.Sqlc - File: ./org/openbravo/erpCommon/ad_reports/ReportValuationStock_data.xsql processed
[java] java.sql.SQLException: ORA-00904: "TOTAL_COST": invalid identifier
[java] 814 [main] ERROR org.openbravo.data.Sqlc - SQL error in query:
[java]
[java] at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
[java] at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
[java] at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
[java] at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
[java] at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:213)
[java] at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:796)
[java] at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1031)
[java]
[java] at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:836)
[java] SELECT M_PRODUCT_CATEGORY.NAME AS CATEGORY_NAME, A.M_PRODUCT_ID, AD_COLUMN_IDENTIFIER(TO_CHAR('M_Product'), TO_CHAR(M_PRODUCT.M_PRODUCT_ID), TO_CHAR(?)) AS PRODUCT_NAME,
[java] at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1124)
[java] A.QTY, C_UOM.NAME AS UOM_NAME,
[java] at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
[java] C_CURRENCY_CONVERT(M_GET_PRODUCT_COST(A.M_PRODUCT_ID,TO_DATE(?), NULL), ?, ?, COALESCE(MC.DATEFROM,TO_DATE(?)), NULL, MC.AD_CLIENT_ID, MC.AD_ORG_ID) AS AVERAGE_COST,
[java] at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)
[java] at org.openbravo.data.Sqlc.query(Sqlc.java:627)
[java] at org.openbravo.data.Sqlc.endElement(Sqlc.java:507)
[java] at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
[java] at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
[java] A.QTY * C_CURRENCY_CONVERT(M_GET_PRODUCT_COST(A.M_PRODUCT_ID,TO_DATE(?), NULL), ?, ?, COALESCE(MC.DATEFROM,TO_DATE(?)), NULL, MC.AD_CLIENT_ID, MC.AD_ORG_ID) AS TOTAL_COST
[java] FROM M_PRODUCT_CATEGORY,
[java] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
[java] (SELECT M_PRODUCT_ID, SUM(MOVEMENTQTY) AS QTY, C_UOM_ID FROM M_TRANSACTION, M_LOCATOR
[java] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
[java] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
[java] WHERE M_TRANSACTION.M_LOCATOR_ID = M_LOCATOR.M_LOCATOR_ID
[java] AND MOVEMENTDATE < to_date(?)
[java] AND M_LOCATOR.M_WAREHOUSE_ID = ?
[java] GROUP BY M_PRODUCT_ID, C_UOM_ID) A, C_UOM,
[java] M_PRODUCT LEFT JOIN M_COSTING MC ON MC.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
[java] WHERE A.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
[java] AND A.C_UOM_ID = C_UOM.C_UOM_ID
[java] AND M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
[java] AND 1=1
[java] AND A.QTY <>0
[java] GROUP BY A.M_PRODUCT_ID, CATEGORY_NAME ,PRODUCT_NAME,A.QTY, UOM_NAME, AVERAGE_COST, TOTAL_COST
[java] ORDER BY CATEGORY_NAME, PRODUCT_NAME
[java] Exception:java.sql.SQLException: ORA-00904: "TOTAL_COST": invalid identifier
[java]
[java] 850 [main] ERROR org.openbravo.data.Sqlc - 1 errors found! |
|