← Back to team overview

openerp-india team mailing list archive

[Bug 1208899] Re: budget module: budgetary positions

 

Hello,

practical amount doesn't depend on paid date as well as it will
calculate when you save the budget not when you confirmed the budget,
because its function field so when you create the budget then practical
amount will be appears.

We have two amount on budget one is the Theoretical Amount, and it will
calculate like this.

elapsed_days = Days elapsed till current date
total_days = Duration of budget in Days
planned_amt = Amount Allocated for Budget

Theoretical Amount = (elapsed_days / total_days)* planned_amt

Practical amount : see the code for practical amount

    def _prac_amt(self, cr, uid, ids,context={}):
        res = {}
        for line in self.browse(cr, uid, ids):
            acc_ids = [x.id for x in line.general_budget_id.account_ids]
            if not acc_ids:
                raise osv.except_osv(_('Error!'),_("The General Budget '%s' has no Accounts!") % str(line.general_budget_id.name))

            date_to = line.date_to
            date_from = line.date_from
            if context.has_key('wizard_date_from'):
                date_from = context['wizard_date_from']
            if context.has_key('wizard_date_to'):
                date_to = context['wizard_date_to']
            cr.execute("select sum(amount) from account_analytic_line where account_id=%s and (date "
                       "between to_date(%s,'yyyy-mm-dd') and to_date(%s,'yyyy-mm-dd')) and "
                       "general_account_id=ANY(%s)", (line.analytic_account_id.id, date_from, date_to,acc_ids,))
            result = cr.fetchone()[0]
            if result is None:
                result = 0.00
            res[line.id] = result
        return res

So it will use the general account on query and it will show the result
only when you have analytic account line with the same duration also
with same analytic account and same general account.

Let me give you one example:
Create one purchase order enter the analytic account = "Your Company / Internal / Administrative" here your purchase order total consider as of budget amount. Confirm the purchase order > Create Invoice > Validate Created supplier Invoice now analytic line will be created with analytic account = "Your Company / Internal / Administrative" and general account = ''expense account".

Now create budget line and make sure that you have to enter same
analytic account and assigned the same general account .When you save
the budget line, you seen the Practical amount. if you have more
analytic journal item with the same period then it will return with the
sum of all lines.

So please keep in mind Practical amount doesn't calculate when you
approve the budget and also its doesn't depend on paid date.

Hope my explanation is good enough.

Thanks for reporting!


** Changed in: openobject-addons
       Status: New => Invalid

** Converted to question:
   https://answers.launchpad.net/openobject-addons/+question/239153

-- 
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/1208899

Title:
  budget module: budgetary positions

Status in OpenERP Addons (modules):
  Invalid

Bug description:
  Hi,

  In openerp v7, it seems there might be a bug in managing basic
  budgets. Here are the steps to reproduce it:

  1) create a new budget
  2) create a budget line and assign (or don't, it doesn't change the final result) analytic account.
  3) fill in duration dates and create a new budgetary position which should take figures from on general ledger account
  4) set the amount for this budget line and leave payment date empty.
  5) make sure that the general ledger account used above is not empty (balance > 0 if possible)

  Once you approve the budget you'll see that practical date is still
  ZERO, i.e. it's not taking any data from the general ledger account.

  Is this a bug? if not, what's the reason to define a budgetary
  position against a general ledger account ?

  
  Best Regards

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


References