Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0022694Openbravo ERP09. Financial managementpublic2012-12-28 09:382013-03-14 11:50
malsasua 
naiaramartinez 
highminoralways
closedfixed 
5
 
 
pramakrishnan
Google Chrome
Core
No
0022694: wrong amount with accruals & deferrals post invoice [oracle]
In oracle, the amount calculate when you post an invoice with deferred revenue is wrong.
F&B
. create new sales invoice
. create new line:
 . product: Cerveza Ale 0.5 L
 . invoiced qty: 1
 . net unit price & list price: 350
 . deferred revenue: selected
 . revenue plan type: monthly
 . period number: 12
 . starting period: Nov-12
process and post
The accounting generated is:
the amount of entries to deferred account is 29.00
and it should be 29.17
change in method calculateAccDefPlan of file DocInvoice.java
from
 BigDecimal periodAmount = amount.divide(new BigDecimal(periodNumber), BigDecimal.ROUND_HALF_UP);

to
    int stdPrecision = OBDal.getInstance().get(Currency.class, this.C_Currency_ID)
        .getStandardPrecision().intValue();
    BigDecimal periodAmount = amount.divide(new BigDecimal(periodNumber),
        new MathContext(32, RoundingMode.HALF_UP)).setScale(stdPrecision, BigDecimal.ROUND_HALF_UP);
No tags attached.
related to defect 0023327 closed naiaramartinez Add SetAdminMode(true) to avoid an error 
Issue History
2012-12-28 09:38malsasuaNew Issue
2012-12-28 09:38malsasuaAssigned To => dmiguelez
2012-12-28 09:38malsasuaWeb browser => Google Chrome
2012-12-28 09:38malsasuaModules => Core
2012-12-28 09:38malsasuaTriggers an Emergency Pack => No
2012-12-28 10:26malsasuaWeb browserGoogle Chrome => Google Chrome
2012-12-28 10:26malsasuaProposed Solution updated
2013-01-11 13:51naiaramartinezAssigned Todmiguelez => naiaramartinez
2013-01-11 13:51naiaramartinezStatusnew => scheduled
2013-01-11 13:51naiaramartinezfix_in_branch => pi
2013-01-14 11:13naiaramartinezNote Added: 0055501
2013-03-14 10:27hgbotCheckin
2013-03-14 10:27hgbotNote Added: 0057243
2013-03-14 10:27hgbotStatusscheduled => resolved
2013-03-14 10:27hgbotResolutionopen => fixed
2013-03-14 10:27hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c305b1980e666b90a4aa386a1db9630f937aec11 [^]
2013-03-14 11:50pramakrishnanReview Assigned To => pramakrishnan
2013-03-14 11:50pramakrishnanNote Added: 0057251
2013-03-14 11:50pramakrishnanStatusresolved => closed
2013-03-18 12:20naiaramartinezRelationship addedrelated to 0023327

Notes
(0055501)
naiaramartinez   
2013-01-14 11:13   
Test Plan
log in as F&B International Group Admin Role.

Go to Product window and select Cerveza Ale 0.5 L. Go to Accounting tab and fill out Product Deferred Revenue.

Go to Sales invoice window
  create new sales invoice
  create new line:
    product: Cerveza Ale 0.5 L
    invoiced qty: 1
    net unit price & list price: 350
    deferred revenue: selected
    revenue plan type: monthly
    period number: 12
    starting period: Nov-12
process and post it.

The accounting generated is:
the amount of entries to deferred account is 29.17, and it is correct
(0057243)
hgbot   
2013-03-14 10:27   
Repository: erp/devel/pi
Changeset: c305b1980e666b90a4aa386a1db9630f937aec11
Author: Naiara Martinez <naiara.martinez <at> openbravo.com>
Date: Mon Jan 14 10:24:20 2013 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/c305b1980e666b90a4aa386a1db9630f937aec11 [^]

fixed bug 22694: wrong amount with accruals & deferrals post invoice

---
M src/org/openbravo/erpCommon/ad_forms/DocInvoice.java
---
(0057251)
pramakrishnan   
2013-03-14 11:50   
Code Review + Testing - OK.