details:   /erp/devel/pi/rev/8925b5958741
changeset: 6485:8925b5958741
user:      David Alsasua <david.alsasua <at> openbravo.com>
date:      Wed Feb 24 19:00:37 2010 +0100
summary:   fixes issue 12367: Matched puchase invoice not balanced
Now the cost of the product is calculated using
the accounting date of the order

diffstat:

 src/org/openbravo/erpCommon/ad_forms/DocMatchInv.java      |  2 +-
 src/org/openbravo/erpCommon/ad_forms/DocMatchInv_data.xsql |  4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r 44c644a0fb7c -r 8925b5958741 
src/org/openbravo/erpCommon/ad_forms/DocMatchInv.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocMatchInv.java     Wed Feb 24 
16:42:12 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/DocMatchInv.java     Wed Feb 24 
19:00:37 2010 +0100
@@ -138,7 +138,7 @@
 
     FieldProvider[] data = getObjectFieldProvider();
     BigDecimal bdCost = new 
BigDecimal(DocMatchInvData.selectProductAverageCost(conn, data[0]
-        .getField("M_Product_Id"), data[0].getField("DateAcct")));
+        .getField("M_Product_Id"), data[0].getField("orderAcctDate")));
     String strScale = DocMatchInvData.selectClientCurrencyPrecission(conn, 
vars.getClient());
     bdCost = bdCost.multiply(new BigDecimal(data[0].getField("Qty"))).setScale(
         new Integer(strScale), RoundingMode.HALF_UP);
diff -r 44c644a0fb7c -r 8925b5958741 
src/org/openbravo/erpCommon/ad_forms/DocMatchInv_data.xsql
--- a/src/org/openbravo/erpCommon/ad_forms/DocMatchInv_data.xsql        Wed Feb 
24 16:42:12 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/DocMatchInv_data.xsql        Wed Feb 
24 19:00:37 2010 +0100
@@ -26,7 +26,7 @@
           '' AS CREATED, '' AS CREATEDBY, '' AS UPDATED, '' AS UPDATEDBY, '' 
AS M_INOUTLINE_ID,
           '' AS C_INVOICELINE_ID, '' AS M_PRODUCT_ID, '' AS DATETRX, '' AS 
QTY, '' AS PROCESSING,
           '' AS PROCESSED, '' AS POSTED, '' AS DATEACCT, '' AS DATEDOC, '' AS 
C_BPARTNER_ID,
-          '' AS LINENETAMT, '' AS C_CURRENCY_ID, '' AS stdprecision
+          '' AS LINENETAMT, '' AS C_CURRENCY_ID, '' AS stdprecision, '' as 
orderAcctDate
         FROM DUAL
       ]]>
     </Sql>
@@ -37,7 +37,7 @@
     <![CDATA[
       SELECT M.M_MATCHINV_ID, M.AD_CLIENT_ID, M.AD_ORG_ID, M.ISACTIVE, 
M.CREATED, M.CREATEDBY, M.UPDATED,
         M.UPDATEDBY, M.M_INOUTLINE_ID, M.C_INVOICELINE_ID, M.M_PRODUCT_ID, 
M.DATETRX, M.QTY, M.PROCESSING,
-        M.PROCESSED, M.POSTED, M.DATETRX AS DATEACCT, M.DATETRX AS DATEDOC, 
I.C_BPARTNER_ID, IO.DATEACCT
+        M.PROCESSED, M.POSTED, M.DATETRX AS DATEACCT, M.DATETRX AS DATEDOC, 
I.C_BPARTNER_ID, IO.DATEACCT as orderAcctDate
       FROM M_MATCHINV M, C_INVOICELINE IL, C_INVOICE I, M_INOUTLINE IOL, 
M_INOUT IO
       WHERE IL.C_INVOICELINE_ID = M.C_INVOICELINE_ID
         AND IL.C_INVOICE_ID = I.C_INVOICE_ID

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to