Comment 6 for bug 784339

Revision history for this message
Graeme Gellatly (gdgellatly) wrote : Re: [Bug 784339] Re: [stable 6.0.2] Account Balance Sheet parser logic error leads to incorrect totals amounts and developer confusion

Vinay,

You don't get it, I couldn't care less what types you have. They don't
matter. You have serious bugs in the report and some more minor ones I
don't report yet, like you cannot filter a balance sheet between 2 periods
or dates, it is a point in time report. And anyway I just check latest
6.0.2 sources again and in the balance sheet parser your types are still
hard coded as 94<http://bazaar.launchpad.net/%7Eopenerp/openobject-addons/6.0/view/head:/account/report/account_balance_sheet.py#L94>

        types = [

  95<http://bazaar.launchpad.net/%7Eopenerp/openobject-addons/6.0/view/head:/account/report/account_balance_sheet.py#L95>

            'liability',

  96<http://bazaar.launchpad.net/%7Eopenerp/openobject-addons/6.0/view/head:/account/report/account_balance_sheet.py#L96>

            'asset'

  97<http://bazaar.launchpad.net/%7Eopenerp/openobject-addons/6.0/view/head:/account/report/account_balance_sheet.py#L97>

        ]

so where is this new equity type? Equity is no longer on the balance sheet?

You have function called sum_cr which actually sums debits and vice versa.
You have a balance sheet where the totals do not add up to the amounts above
it (depending on profit or loss)

If your bank account is $1000 overdrawn, it will show as being $1000 in
credit.
If you generate a loss or a profit, you add or subtract it from different
sides of the ledger

Vinay - this is fundamental errors, not wishlist or opinion.

On Fri, May 20, 2011 at 1:04 AM, Vinay Rana (openerp) <
<email address hidden>> wrote:

> Hello Graeme Gellatly,
>
> I know the balance sheet formula :
> Assets = Liabilities + Shareholders' Equity
>
> Current report is supporting equity type.The only thing remain is set the
> proper configuration in user defined account type form.
> The existing equity type is not shareholders equity.If you want this as
> shareholders equity then you just need to change the selection 'Balance
> Sheet(Liability side).'
> I have set this as a opinion for other thing.
>
> We already assigned one of the following wishlist bug for sign related
> issue:
> https://bugs.launchpad.net/openobject-addons/+bug/740132
>
> Hope this will help you
> Thanks.
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/784339
>
> Title:
> [stable 6.0.2] Account Balance Sheet parser logic error leads to
> incorrect totals amounts and developer confusion
>
> Status in OpenERP Modules (addons):
> Opinion
>
> Bug description:
> If you look at the section where it calculates sum_dr and sum_cr it is
> incorrect. Well it is technically correct, but in the sense of having
> a balance sheet that balances it is incorrect.
>
> Take the accounting equation property = property rights expanded to
> assets = liabilities + equity
>
> In the case of a net profit we incorrectly add the result to sum_dr,
> our equity has increased afterall, so sum_cr should increase, (this
> behaviour is correct, except the function is named wrong) however in
> the case of a net loss we subtract the amount from sum_cr (which
> should be sum_dr) which is incorrect as our equity has reduced.
>
> However here is the first bug - sum_dr and sum_cr are around the wrong
> way - sum_cr is increased for asset accounts, and sum_dr is increased
> for liabilities - it should be the other way around
>
> Put another way, for a balance sheet, we don't really want the totals
> to be the sum of dr's and cr's, we want it to be the total of the
> stuff on the left (Assets) and the total of the stuff on the right
> (Property Rights).
>
> So in the case of a Net Profit we must increase equity (credit) and in
> the case of a net loss we must reduce equity (credit). At no point
> should we be changing debits. The value of our Assets has not changed
> (in so far that a net loss already reduces our assets), it is our
> equity that has reduced.
>
> Now to make this one step more confusing, and for some unknown reason
> it has been decided to leave liabilities as a negative balance, and
> then on the report use absolute value which is also incorrect. Many
> assets and liabilities should have a balance opposite of the standard,
> Accumulated depreciation for example in Assets, VAT Paid in
> Liabilities, Bank Accounts temporarily in overdraft.
>
> In my own parser, which I have written, to resolve this we declare a
> dictionary called signs and at the point we compute the
> account.balance we multiple it by the sign.
>
> sign = {
> 'fixed_asset': 1,
> 'asset': 1,
> 'liability': -1,
> 'fixed_liability': -1,
> 'equity': -1,
> }
>
> We use more types than standard but you get the idea. Assets are
> their balance, liability is their balance *-1.
>
> Then all we do in the for account in accounts loop is make the
> balance: account.balance * sign[typ]
>
> So in summary
> sum_dr and sum_cr are round the wrong way.
> Adding a net loss to Assets is incorrect - it should be subtracted from
> Equity.
> values (already reported bug) should not be absolute, but rather their
> inverse for liability and equity accounts.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/openobject-addons/+bug/784339/+subscribe
>