Public bug reported:

On runbot

http://7-0-30413.runbot.openerp.com/?db=7-0-30413-all&ts=1392313676667#view_type=form&model=crossovered.budget&menu_id=531&action=603


Date of computation: 02/13/2014

Create a Budget: Budget 2014
from: 01/01/2014 
to: 12/31/2014

Budget Lines:
Analytic Account | Budgetary Position | Start Date | End Date | Paid Date 
|Planned Amount | Practical Amount | Theoretical Amount | Percentage  
Seagate P1 | Purchases | 02/01/2014 | 02/28/2014 | False | 28000.00 | 0.00 | >> 
12444.44 << | 0.00      


Theorical Amount : 12444.44

This value is wrong 
[7.0]   
http://bazaar.launchpad.net/~openerp/openobject-addons/7.0/view/head:/account_budget/account_budget.py#L167
[trnk]  
http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/account_budget/account_budget.py#L165

These lines say:

theo_amt = float(elapsed.days / float(total.days)) * line.planned_amount

theo_amt = float( (02/13/2014 - 02/01/2014).days / float( ( 02/28/2014 -
02/01/2014).days )) * 28000

theo_amt = float( 12 / float( 27 )) * 28000

theo_amt = 12444.44


This should be like this:


theo_amt = float(( elapsed.days + 1) / float(total.days + 1)) * 
line.planned_amount

theo_amt = float( ((02/13/2014 - 02/01/2014).days + 1)/ float( (
02/28/2014 - 02/01/2014).days + 1)) * 28000

theo_amt = float( 13 / float( 28 )) * 28000

theo_amt = 13000.00

Best Regards.

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1279922

Title:
  [account_budget] When computing theorical amount one (1) day is
  missing from elapsed days and total days

Status in OpenERP Addons (modules):
  New

Bug description:
  On runbot

  
http://7-0-30413.runbot.openerp.com/?db=7-0-30413-all&ts=1392313676667#view_type=form&model=crossovered.budget&menu_id=531&action=603

  
  Date of computation: 02/13/2014

  Create a Budget: Budget 2014
  from: 01/01/2014 
  to: 12/31/2014

  Budget Lines:
  Analytic Account | Budgetary Position | Start Date | End Date | Paid Date 
|Planned Amount | Practical Amount | Theoretical Amount | Percentage        
  Seagate P1 | Purchases | 02/01/2014 | 02/28/2014 | False | 28000.00 | 0.00 | 
>> 12444.44 << | 0.00    


  Theorical Amount : 12444.44

  This value is wrong 
  [7.0]         
http://bazaar.launchpad.net/~openerp/openobject-addons/7.0/view/head:/account_budget/account_budget.py#L167
  [trnk]        
http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/account_budget/account_budget.py#L165

  These lines say:

  theo_amt = float(elapsed.days / float(total.days)) *
  line.planned_amount

  theo_amt = float( (02/13/2014 - 02/01/2014).days / float( ( 02/28/2014
  - 02/01/2014).days )) * 28000

  theo_amt = float( 12 / float( 27 )) * 28000

  theo_amt = 12444.44


  This should be like this:

  
  theo_amt = float(( elapsed.days + 1) / float(total.days + 1)) * 
line.planned_amount

  theo_amt = float( ((02/13/2014 - 02/01/2014).days + 1)/ float( (
  02/28/2014 - 02/01/2014).days + 1)) * 28000

  theo_amt = float( 13 / float( 28 )) * 28000

  theo_amt = 13000.00

  Best Regards.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1279922/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~openerp-india
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-india
More help   : https://help.launchpad.net/ListHelp

Reply via email to