Hi,

Here's the actual query in AccountBO.hbm.xml that picks up the last loan
amount:

<query name="account.lastLoanAmountForCustomer">
        <![CDATA[select loan.loanAmount
                from org.mifos.application.accounts.loan.business.LoanBO
loan
                where loan.accountId=(select atxn.account.accountId from
                org.mifos.application.accounts.business.AccountTrxnEntity
atxn
                where atxn.accountTrxnId=(select max(at.accountTrxnId)
                from
org.mifos.application.accounts.business.AccountTrxnEntity at
                where at.account.customer.customerId=:customerId
                and at.account.accountState.id in (5,6,7,8,9) and
at.accountActionEntity.id=10
                and at.account.accountId!=:excludeAccountId))
        ]]>
    </query>




Malini

On Thu, Aug 14, 2008 at 11:43 AM, Malini K <[EMAIL PROTECTED]> wrote:

> Hi Aliya,
>
> We too encountered the bug 1954 (what we found exactly matched the bug) but
> this particular issue is independent of bug 1954.
>
> While bug 1954 focuses on 'When the metrics are calculated?' our concern is
> 'how is it calculated?' because the current way of calculation contradicts
> the spec, with respect to the set of account states being considered for
> calculation.
>
> Our question is: Should we change the code to pick up only accounts in
> 'Closed- Obligations met' status and calculate the last loan amount?
>
> Note: This bug is applicable for group as well as client performance
> metrics. So we need to fix both places. Technically speaking, both metrics
> use a common query to retreive the last loan amount and the fix will be to
> change this query to pick up only 'closed- obligation met' state.
>
>
> Malini & Pramod,
> ThoughtWorks.
>
>
> On Thu, Aug 14, 2008 at 8:49 AM, Aliya Walji <[EMAIL PROTECTED]
> > wrote:
>
>>  I think it's a bug in the implementation?  If I'm not mistaken, there is
>> a bug that already describes the behavior for last loan amount since there
>> is an inconsistency between the group and client loan performance metric.
>> According to Emily in thebug, it should be the behavior your describe in the
>> spec "amount of the last closed-oblication met loan"
>>
>>
>>
>> https://mifos.dev.java.net/issues/show_bug.cgi?id=1954
>>
>>
>>
>> I'm a bit confused though, because according to the bug, the test team
>> found the client loan account metric to be performing correctly (and group
>> loans were incorrect), which is inconsistent with what TW has uncovered?
>>
>>
>>
>> Aliya
>>
>>
>>
>> *From:* [EMAIL PROTECTED] [mailto:
>> [EMAIL PROTECTED] *On Behalf Of *Ryan
>> Whitney
>> *Sent:* Wednesday, August 13, 2008 12:58 AM
>> *To:* Mifos functional discussions
>> *Subject:* [Mifos-functional] Issue: Client Performance Metrics - Last
>> Loan Amount # - Implementation is different than spec
>>
>>
>>
>> Hey,
>>
>> Working with Thoughtworks, they have discovered there's an inconsistency
>> with how Last Loan Amount is calculated for the client Performance Metric
>>
>> >From what I could find on mifos.org:
>>
>> http://www.mifos.org/knowledge/functional-specs/clients#Performance_Metrics
>>
>> Should only consider: Amount of the most recently "closed-obligations met"
>> loan
>>
>> But, in the code, it's considering five actual states:
>> Look at the Performance History issue with client -
>>
>>    - AccountState-ActiveInGoodStanding
>>    - AccountState-ClosedObligationMet
>>    - AccountState-ClosedWrittenOff
>>    - AccountState-ClosedRescheduled
>>    - AccountState-ActiveInBadStanding
>>
>>
>> Is this a bug in the implementation or the spec?
>>
>> Ryan
>>
>>
>> *Ryan Whitney **
>> **Mifos Technical Program Manager
>> [EMAIL PROTECTED]
>> Mifos - Technology that Empowers Microfinance (www.mifos.org)
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Mifos-functional mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/mifos-functional
>>
>>
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mifos-functional mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-functional

Reply via email to