Closing an accounting period

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Closing an accounting period

Rees Watkins
Hi

I am attempting to understand the closing of accounting periods in Ofbiz

In order to close an accounting period the system needs to make an entry into Retained Income and a contra entry in a Profit and Loss account.

The code seems to require an Account Type Id of "PROFIT_LOSS_ACCOUNT"

However there does not appear to be an GlAccount of that type in the system and so an entry is make into the Error Journal.

Does anyone have know if this is an error and what I can do to resolve it.

Thank you
Rees



Reply | Threaded
Open this post in threaded view
|

Re: Closing an accounting period

Sharan-F
Hi Rees

I'm doing some documentation on accounting on the OFBiz Wiki and have come across this problem. Here's the link to the time periods bit. http://docs.ofbiz.org/display/OFBIZ/05+Time+Period

I would say that in general when you close a financial year you would want to move the profit into retained earnings etc (or if you pay a dividend or bonus or whatever)

What OFBiz seems to do is that it does this movement transaction from P&L to Balance sheet whenever you do a period closing even if it's not at the end of the financial year. Personally I would have expected a period close only to stop you from posting to that closed period but technically speaking I dont think what OFBiz is doing is wrong.

To solve your problem - I think it's a matter of mappings. The demo data doesnt come with GL Account Default mapping for Profit Loss (but it does have one for Retained Earnings).

Here's how to fix it using an example from Hotwax Demo:

1. In Accounting Manager / General Ledger / Setup for Company
2. Select Chart of Accounts and Create an assignment to 801000 Income / Loss from Business Net of Expenses (if its already there it was me that added it in to perform the test!)
3. In Accounting Manager / General Ledger  / Setup for Company / GL Account defaults
4. Go to GL Account Type Defaults (which is the first one) and add a mapping for 'Profit Loss' to the account 801000

If you now try to close a time period – it should post with one side of the journal going to Retained Earnings and the other to the Profit Loss Mapping.

Hope this helps.

Thanks
Sharan

Rees Watkins wrote
Hi

I am attempting to understand the closing of accounting periods in Ofbiz

In order to close an accounting period the system needs to make an entry into Retained Income and a contra entry in a Profit and Loss account.

The code seems to require an Account Type Id of "PROFIT_LOSS_ACCOUNT"

However there does not appear to be an GlAccount of that type in the system and so an entry is make into the Error Journal.

Does anyone have know if this is an error and what I can do to resolve it.

Thank you
Rees


Reply | Threaded
Open this post in threaded view
|

Re: Closing an accounting period

hans_bakker
shouldn't we add this to the demo data?

On Sun, 2009-03-15 at 18:15 -0700, Sharan-F wrote:

> Hi Rees
>
> I'm doing some documentation on accounting on the OFBiz Wiki and have come
> across this problem. Here's the link to the time periods bit.
> http://docs.ofbiz.org/display/OFBIZ/05+Time+Period
> http://docs.ofbiz.org/display/OFBIZ/05+Time+Period 
>
> I would say that in general when you close a financial year you would want
> to move the profit into retained earnings etc (or if you pay a dividend or
> bonus or whatever)
>
> What OFBiz seems to do is that it does this movement transaction from P&L to
> Balance sheet whenever you do a period closing even if it's not at the end
> of the financial year. Personally I would have expected a period close only
> to stop you from posting to that closed period but technically speaking I
> dont think what OFBiz is doing is wrong.
>
> To solve your problem - I think it's a matter of mappings. The demo data
> doesnt come with GL Account Default mapping for Profit Loss (but it does
> have one for Retained Earnings).
>
> Here's how to fix it using an example from Hotwax Demo:
>
> 1. In Accounting Manager / General Ledger / Setup for Company
> 2. Select Chart of Accounts and Create an assignment to 801000 Income / Loss
> from Business Net of Expenses (if its already there it was me that added it
> in to perform the test!)
> 3. In Accounting Manager / General Ledger  / Setup for Company / GL Account
> defaults
> 4. Go to GL Account Type Defaults (which is the first one) and add a mapping
> for 'Profit Loss' to the account 801000
>
> If you now try to close a time period – it should post with one side of the
> journal going to Retained Earnings and the other to the Profit Loss Mapping.
>
> Hope this helps.
>
> Thanks
> Sharan
>
>
> Rees Watkins wrote:
> >
> > Hi
> >
> > I am attempting to understand the closing of accounting periods in Ofbiz
> >
> > In order to close an accounting period the system needs to make an entry
> > into Retained Income and a contra entry in a Profit and Loss account.
> >
> > The code seems to require an Account Type Id of "PROFIT_LOSS_ACCOUNT"
> >
> > However there does not appear to be an GlAccount of that type in the
> > system and so an entry is make into the Error Journal.
> >
> > Does anyone have know if this is an error and what I can do to resolve it.
> >
> > Thank you
> > Rees
> >
> >
> >
> >
> >
>
--
Antwebsystems.com: Quality OFBiz services for competitive rates

Reply | Threaded
Open this post in threaded view
|

Re: Closing an accounting period

David E Jones-3

Yes, this does seem like something that should be in the demo data  
along with the rest of the demo chart of accounts. Actually... I'm a  
bit surprised it isn't there. :)

-David


On Mar 15, 2009, at 8:46 PM, Hans Bakker wrote:

> shouldn't we add this to the demo data?
>
> On Sun, 2009-03-15 at 18:15 -0700, Sharan-F wrote:
>> Hi Rees
>>
>> I'm doing some documentation on accounting on the OFBiz Wiki and  
>> have come
>> across this problem. Here's the link to the time periods bit.
>> http://docs.ofbiz.org/display/OFBIZ/05+Time+Period
>> http://docs.ofbiz.org/display/OFBIZ/05+Time+Period
>>
>> I would say that in general when you close a financial year you  
>> would want
>> to move the profit into retained earnings etc (or if you pay a  
>> dividend or
>> bonus or whatever)
>>
>> What OFBiz seems to do is that it does this movement transaction  
>> from P&L to
>> Balance sheet whenever you do a period closing even if it's not at  
>> the end
>> of the financial year. Personally I would have expected a period  
>> close only
>> to stop you from posting to that closed period but technically  
>> speaking I
>> dont think what OFBiz is doing is wrong.
>>
>> To solve your problem - I think it's a matter of mappings. The demo  
>> data
>> doesnt come with GL Account Default mapping for Profit Loss (but it  
>> does
>> have one for Retained Earnings).
>>
>> Here's how to fix it using an example from Hotwax Demo:
>>
>> 1. In Accounting Manager / General Ledger / Setup for Company
>> 2. Select Chart of Accounts and Create an assignment to 801000  
>> Income / Loss
>> from Business Net of Expenses (if its already there it was me that  
>> added it
>> in to perform the test!)
>> 3. In Accounting Manager / General Ledger  / Setup for Company / GL  
>> Account
>> defaults
>> 4. Go to GL Account Type Defaults (which is the first one) and add  
>> a mapping
>> for 'Profit Loss' to the account 801000
>>
>> If you now try to close a time period – it should post with one  
>> side of the
>> journal going to Retained Earnings and the other to the Profit Loss  
>> Mapping.
>>
>> Hope this helps.
>>
>> Thanks
>> Sharan
>>
>>
>> Rees Watkins wrote:
>>>
>>> Hi
>>>
>>> I am attempting to understand the closing of accounting periods in  
>>> Ofbiz
>>>
>>> In order to close an accounting period the system needs to make an  
>>> entry
>>> into Retained Income and a contra entry in a Profit and Loss  
>>> account.
>>>
>>> The code seems to require an Account Type Id of  
>>> "PROFIT_LOSS_ACCOUNT"
>>>
>>> However there does not appear to be an GlAccount of that type in the
>>> system and so an entry is make into the Error Journal.
>>>
>>> Does anyone have know if this is an error and what I can do to  
>>> resolve it.
>>>
>>> Thank you
>>> Rees
>>>
>>>
>>>
>>>
>>>
>>
> --
> Antwebsystems.com: Quality OFBiz services for competitive rates
>

Reply | Threaded
Open this post in threaded view
|

Closing an accounting period - missing figures

Rees Watkins
Hi All

Thanks for the help on my previous question.

When we close an accounting period the simpe method "closeFinancialTimePeriod" in GeneralLedgerServices.xml uses a less than operator to select figures to include in closing the period. However when accounting are created and written to acctg_trans_entry a less than or equals is used in simple-method "findCustomTimePeriods" ( called by "postAcctgTrans"  ) to select the time period for the transaction.

This means that figures writting on the closing day are missed when the accounts are closed.

Please can anyone comment on my understanding.

Cheers
Rees


"closeFinancialTimePeriod" - in GeneralLedgerServices.xml
        <entity-condition entity-name="AcctgTransAndEntries" list-name="acctgTransAndEntries">
            <condition-list combine="and">
                <condition-expr field-name="organizationPartyId" operator="equals" env-name="customTimePeriod.organizationPartyId"/>
                <condition-expr field-name="isPosted" operator="equals" value="Y"/>
                <condition-expr field-name="glFiscalTypeId" operator="equals" value="ACTUAL"/>
                <condition-expr field-name="transactionDate" operator="greater-equals" env-name="lastClosedDate"/>
                <condition-expr field-name="transactionDate" operator="less" env-name="customTimePeriod.thruDate"/> <!-- FIXME: Date to Timestamp -->
                <condition-expr field-name="acctgTransTypeId" operator="not-equals" value="PERIOD_CLOSING"/>
                <condition-list combine="or">
                    <condition-expr field-name="glAccountClassId" operator="in" env-name="expenseAccountClassIds"/>
                    <condition-expr field-name="glAccountClassId" operator="in" env-name="revenueAccountClassIds"/>
                    <condition-expr field-name="glAccountClassId" operator="in" env-name="incomeAccountClassIds"/>
                </condition-list>
            </condition-list>
            <order-by field-name="acctgTransId"/>
            <order-by field-name="acctgTransEntrySeqId"/>
        </entity-condition>

PeriodServices.xml
            <iterate entry-name="curOrganizationPartyId" list-name="parentOrganizationPartyIdList">
                <clear-field field-name="orgTimePeriodList"/>
                <entity-condition entity-name="CustomTimePeriod" list-name="orgTimePeriodList">
                    <condition-list combine="and">
                        <condition-list combine="or">
                            <condition-expr field-name="organizationPartyId" operator="equals" env-name="curOrganizationPartyId"/>
                        </condition-list>
                        <condition-expr field-name="fromDate" operator="less-equals" env-name="parameters.findDate"/>
                        <condition-list combine="or">
                            <condition-expr field-name="thruDate" operator="greater-equals" env-name="parameters.findDate"/>
                            <condition-expr field-name="thruDate" operator="equals" env-name="nullField"/>
                        </condition-list>
                        <condition-expr field-name="periodTypeId" operator="in" env-name="parameters.onlyIncludePeriodTypeIdList" ignore-if-empty="true"/>
                    </condition-list>
                </entity-condition>
                <list-to-list list-name="orgTimePeriodList" to-list-name="listSoFar"/>                                
            </iterate>
        </if-not-empty>


Reply | Threaded
Open this post in threaded view
|

Re: Closing an accounting period - missing figures

Rees Watkins
Hi

I believe ofbiz sometimes excluding figures from the balance sheet and sometimes duplicates figures when they occur on the boundary of an account period when the period is closed.

Problem:

If your accounting period ends on 14 March 2009
You have accounting entries for the period ending 14 March entered on 14 March - there are no later accounting entries..
Entries for 14 March are included in the gl_account history table and appear in acctg_trans_entry by ofbiz correctly.

You close the accounting period

An entry is made in acctg_trans_entry for PROFIT_LOSS_ACCOUNT and RETAINED_EARNINGS these figues are calculated on accounting entries up to and excluding entries on 14 March. Ending_balances in gl_account history table are calulated including entries on 14 March.

If you run a balance sheet report:
On14 March ( issue: retained earning loses figures 14 March)
Assets, liablities and Equity figures will be read exclusively from gl_account history table (ie including figures from 14th) but retained earning will be calculated excluding figures from the 14th from acctg_trans_entry.

On15 march ( Assets and Liablities include figures from 14March twice )
Assets, liablities and Equity figures will be read from gl_account history table but the figures for 14 march will be read from gl_account history as well - duplicating them. Retained earning will be calculated including figures from the 14th from acctg_trans_entry.

Solution
On closing a time period the retained earning should include figures from 14 march.. ie the select from acctg_trans_entry- ie add 1 to the date and select < 15 March to include all 14 March entries.
"prepareBalanceSheet" - should not include figures from acctg_trans_entry after the closed time period. Currently it select figures >=. It should only selct figure > than the last closing date.
"prepareIncomeStatement" should include figures from 14th to calculate retained earnings - ie < 15 March.

Kind regards
Rees




________________________________
From: Rees Watkins <[hidden email]>
To: [hidden email]
Sent: Monday, 16 March, 2009 18:57:47
Subject: Closing an accounting period - missing figures

Hi All

Thanks for the help on my previous question.

When we close an accounting period the simpe method "closeFinancialTimePeriod" in GeneralLedgerServices.xml uses a less than operator to select figures to include in closing the period. However when accounting are created and written to acctg_trans_entry a less than or equals is used in simple-method "findCustomTimePeriods" ( called by "postAcctgTrans"  ) to select the time period for the transaction.

This means that figures writting on the closing day are missed when the accounts are closed.

Please can anyone comment on my understanding.

Cheers
Rees


"closeFinancialTimePeriod" - in GeneralLedgerServices.xml
        <entity-condition entity-name="AcctgTransAndEntries" list-name="acctgTransAndEntries">
            <condition-list combine="and">
                <condition-expr field-name="organizationPartyId" operator="equals" env-name="customTimePeriod.organizationPartyId"/>
                <condition-expr field-name="isPosted" operator="equals" value="Y"/>
                <condition-expr field-name="glFiscalTypeId" operator="equals" value="ACTUAL"/>
                <condition-expr field-name="transactionDate" operator="greater-equals" env-name="lastClosedDate"/>
                <condition-expr field-name="transactionDate" operator="less" env-name="customTimePeriod.thruDate"/> <!-- FIXME: Date to Timestamp -->
                <condition-expr field-name="acctgTransTypeId" operator="not-equals" value="PERIOD_CLOSING"/>
                <condition-list combine="or">
                    <condition-expr field-name="glAccountClassId" operator="in" env-name="expenseAccountClassIds"/>
                    <condition-expr field-name="glAccountClassId" operator="in" env-name="revenueAccountClassIds"/>
                    <condition-expr field-name="glAccountClassId" operator="in" env-name="incomeAccountClassIds"/>
                </condition-list>
            </condition-list>
            <order-by field-name="acctgTransId"/>
            <order-by field-name="acctgTransEntrySeqId"/>
        </entity-condition>

PeriodServices.xml
            <iterate entry-name="curOrganizationPartyId" list-name="parentOrganizationPartyIdList">
                <clear-field field-name="orgTimePeriodList"/>
                <entity-condition entity-name="CustomTimePeriod" list-name="orgTimePeriodList">
                    <condition-list combine="and">
                        <condition-list combine="or">
                            <condition-expr field-name="organizationPartyId" operator="equals" env-name="curOrganizationPartyId"/>
                        </condition-list>
                        <condition-expr field-name="fromDate" operator="less-equals" env-name="parameters..findDate"/>
                        <condition-list combine="or">
                            <condition-expr field-name="thruDate" operator="greater-equals" env-name="parameters.findDate"/>
                            <condition-expr field-name="thruDate" operator="equals" env-name="nullField"/>
                        </condition-list>
                        <condition-expr field-name="periodTypeId" operator="in" env-name="parameters.onlyIncludePeriodTypeIdList" ignore-if-empty="true"/>
                    </condition-list>
                </entity-condition>
                <list-to-list list-name="orgTimePeriodList" to-list-name="listSoFar"/>                                
            </iterate>
        </if-not-empty>