Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0019291Openbravo ERP08. Project and service managementpublic2011-12-13 13:102012-09-18 13:59
VictorVillar 
dmiguelez 
highminoralways
closedout of date 
5
3.0MP6 
 
Core
No
0019291: Collected field on Project Profitability Report is not recording payments made with APR flow
Collected field on Project Profitability Report is not recording payments made with APR flow. It sums only from C_DEBT_PAYMENT but not from FIN_PAYMENT table.
We can see in ReportProjectProfitability_data.xsql in the subquery DDD line 177 where calculates the sum of the Collected field. it calls a function C_INVOICE_PERCENTAGE_PAID.xml:


SELECT SUM(C_DB_PERCENTAGE_PAID(DB.C_Debt_Payment_ID)*
      C_Currency_Convert(DB.amount,DB.C_Currency_ID,I.C_Currency_ID,
      now(), null, I.AD_Client_ID, I.AD_Org_ID))/
  (CASE SUM(C_Currency_Convert(DB.amount,DB.C_Currency_ID,I.C_Currency_ID,
      now(), null, I.AD_Client_ID, I.AD_Org_ID)) WHEN 0 THEN to_number(NULL) ELSE SUM(C_Currency_Convert(DB.amount,DB.C_Currency_ID,I.C_Currency_ID,
      now(), null, I.AD_Client_ID, I.AD_Org_ID)) END) INTO v_percentaje
  FROM C_DEBT_PAYMENT DB, C_Invoice I
  WHERE DB.C_Invoice_ID = I.C_Invoice_ID
    AND I.C_INVOICE_ID = p_Invoice_ID;
  RETURN ROUND(v_percentaje,4);
END C_INVOICE_PERCENTAGE_PAID

We realise that only it takes into account the old flow.
It is necessary to add the sum from the FIN_PAYMENT table to the current one. The result is the sum from APR flow and the old one
No tags attached.
Issue History
2011-12-13 13:10VictorVillarNew Issue
2011-12-13 13:10VictorVillarAssigned To => jonalegriaesarte
2011-12-13 13:10VictorVillarModules => Core
2011-12-13 13:10VictorVillarResolution time => 1328655600
2011-12-13 13:15RenateNieuwkoopIssue Monitored: RenateNieuwkoop
2012-01-24 13:42jonalegriaesarteTypedefect => design defect
2012-01-30 17:18jonalegriaesarteTarget Version3.0MP8 => 3.0MP9
2012-03-02 12:56jonalegriaesarteTarget Version3.0MP9 => 3.0MP10
2012-03-29 16:11jonalegriaesarteTarget Version3.0MP10 =>
2012-09-13 10:42jonalegriaesarteAssigned Tojonalegriaesarte => dmiguelez
2012-09-18 13:59dmiguelezNote Added: 0052203
2012-09-18 13:59dmiguelezStatusnew => closed
2012-09-18 13:59dmiguelezResolutionopen => out of date

Notes
(0052203)
dmiguelez   
2012-09-18 13:59   
This was already solved as paid amount is now a property of Invoice