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 <[email protected]>
To: [email protected]
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>


      

Reply via email to