[Mifos-developer] Thousands separator for amounts in Mifos

145 views
Skip to first unread message

Binny Gopinath

unread,
Nov 8, 2011, 11:34:50 PM11/8/11
to Mifos software development
All,

For some of the currencies where exchange rate (compared to USD) is very low, the amounts disbursed could be in hundreds thousands or even millions. And repayments also could run into ten thousands easily. Hence, entering and reading the amounts become very difficult and prone to mistakes.

I assume that a thousands separator is not implemented fully in Mifos as the ticket below is still open:

http://mifosforge.jira.com/browse/MIFOS-3670

Is this something that can implemented by "tweaking" internationalization parameters (LOCALE or currency values?) If yes, can anyone guide me on how I can do it? Even if I can achieve partial results (i.e. some amounts may still not accept/display the thousands separator), I would be interested to know about this. I would like to demo this to the client, if possible, saying that it is not fully supported now, but will be implemented in one of the future releases.

If this cannot be achieved by "tweaking", then I would request one of the volunteers to do some digging into this as I feel this is a very useful feature.

--
Thanks
Binny

Jasmine sandhu

unread,
Nov 9, 2011, 12:41:40 PM11/9/11
to Mifos software development
Hi Binny,

I can dig into this. Can you tell me on what mifos page you were seeing this problem? I'll use this as a starting point to reproduce the problem and look for a solution.

Regards,
Jasmine

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
Mifos-developer mailing list
mifos-d...@lists.sourceforge.net
Unsubscribe or change settings at:
https://lists.sourceforge.net/lists/listinfo/mifos-developer



--
- Climbed Rainier to Raise funds for Asha - please sponsor my climb -
-------------------------------------------------------------------------------------

bankadmin

unread,
Nov 9, 2011, 2:30:56 PM11/9/11
to Mifos software development
Dear Jasmine,

Please see attached screenshot.



 Best Regards
 K | on behalf of Binny
thousend-seperator.jpg

bankadmin

unread,
Nov 9, 2011, 2:36:36 PM11/9/11
to Mifos software development
Another screenshot is attached

On 11/9/2011 9:41 PM, Jasmine sandhu wrote:
thousend-seperator-2.jpg

Binny Gopinath

unread,
Nov 9, 2011, 10:52:08 PM11/9/11
to Mifos software development
Jasmine,

The biggest problem areas will be collection sheet entry, collection sheet preview, loan creation, account summary page for loans/savings, View payment schedule.
Strangely, the thousands separator is handled correctly in the Review installments page and the preview page when creating a new loan.

Were you able to find out if this is something that will need code change or is it something that I (as a 50% techie) can tweak?

Thanks
Binny

Jasmine sandhu

unread,
Nov 10, 2011, 2:57:54 AM11/10/11
to Mifos software development
Hi Binny,

Thanks for the note about the page that worked. I'm far from an expert on this but I googled and looked at the mifos code to understand the problem.

The difference that I could see between a loan product that does not show the thousand separators and the correctly displayed page for creating the loan product is that the incorrect display is still using the old struts/JSP pages for display, while the correct display has been reworked using the new Freemarker template and includes the number formatting.

The place to specify the number format would be in the view template (Freemarker or JSP pages). In looking at one of the Freemarker templates (createLoanAccountPreview.ftl), it is using the Freemarker built-in method called string.number which formats the number per the locale. There is a builtin called string.currency - I wanted to test this but I'm having some trouble getting my Mifos Workspace 2.0 working - but from the Freemarker documentation, the string.currency builtin should format numbers per the locale.

For the old struts/JSP code, the JSP files can also include number formatting for currency type.
I guess to answer your question, I don't think it is a straightforward fix because we'd have to go through all the JSP files, figure out which variables are displaying currency and include a the proper JSP syntax, something like the following:
<fmt:formatNumber value="${variable}" type="currency" />

And, Mifos is suppose to be migrating away from the old struts/JSP code. We can and probably should look at the Freemarker pages to ensure they are using the string.currency method for the currency data - I'll keep you posted once I have my workspace issues straightened out and have a chance to work through this.

Unfortunately, I didn't find a quick fix or a simple tweak.

Jasmine

bankadmin

unread,
Nov 10, 2011, 3:46:17 AM11/10/11
to Mifos software development

Jakob's comment on this (Thousands separator for amounts) would be very useful.

.

Binny Gopinath

unread,
Nov 10, 2011, 7:53:28 AM11/10/11
to Mifos software development

Thanks, Jasmine. I will try what you suggested on a local instance and see if it will help me.
I may come back to you if I need help with this.

Thanks
Binny

Jakub Sławiński

unread,
Nov 10, 2011, 9:11:59 AM11/10/11
to mifos-d...@lists.sourceforge.net

Hi,

I agree with Jasmine, that this issue is caused by the fact that we are
using:

<c:out value="${variable}" />

instead of:

<fmt:formatNumber value="${variable}" type="number" />


The only solution is to fix those places in the jsp code. This might be
a lot of work (there is almost 2k invocations of c:out), but this task
is really easy and should be a perfect task for a volunteers.

Do we have a Jira issue for this task?


Regards,
Jakub.

>> <binny.g...@gmail.com <mailto:binny.g...@gmail.com>>

>> <mailto:mifos-d...@lists.sourceforge.net>


>> Unsubscribe or change settings at:
>> https://lists.sourceforge.net/lists/listinfo/mifos-developer
>>
>>
>>
>>
>> -- - Climbed Rainier

>> <http://aimlessplanet.blogspot.com/> to


>> Raise funds for Asha - please sponsor my climb
>>

>> <http://www.ashanet.org/seattle/teamasha/climb/profile_head.php?p=jasmine>-


>>
>>
>> -------------------------------------------------------------------------------------
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>> RSA(R) Conference 2012
>> Save $700 by Nov 18
>> Register now
>> http://p.sf.net/sfu/rsa-sfdev2dev1
>> Mifos-developer mailing list
>> mifos-d...@lists.sourceforge.net

>> <mailto:mifos-d...@lists.sourceforge.net>


>> Unsubscribe or change settings at:
>> https://lists.sourceforge.net/lists/listinfo/mifos-developer
>>
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>> RSA(R) Conference 2012
>> Save $700 by Nov 18
>> Register now
>> http://p.sf.net/sfu/rsa-sfdev2dev1
>> Mifos-developer mailing list
>> mifos-d...@lists.sourceforge.net

>> <mailto:mifos-d...@lists.sourceforge.net>


>> Unsubscribe or change settings at:
>> https://lists.sourceforge.net/lists/listinfo/mifos-developer
>>
>>
>>
>>
>> --

>> - Climbed Rainier <http://aimlessplanet.blogspot.com/> to Raise funds


>> for Asha - please sponsor my climb

>> <http://www.ashanet.org/seattle/teamasha/climb/profile_head.php?p=jasmine>-


>>
>> -------------------------------------------------------------------------------------
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>> RSA(R) Conference 2012
>> Save $700 by Nov 18
>> Register now
>> http://p.sf.net/sfu/rsa-sfdev2dev1
>>
>>
>> Mifos-developer mailing list
>> mifos-d...@lists.sourceforge.net
>> Unsubscribe or change settings at:
>> https://lists.sourceforge.net/lists/listinfo/mifos-developer
>
>
>
>
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Save $700 by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1
>
>
>
> Mifos-developer mailing list
> mifos-d...@lists.sourceforge.net
> Unsubscribe or change settings at:
> https://lists.sourceforge.net/lists/listinfo/mifos-developer

binny.g...@gmail.com

unread,
Nov 10, 2011, 9:34:07 AM11/10/11
to Mifos software development
http://mifosforge.jira.com/browse/MIFOS-3670

This ticket is for the thousands separator. Is this sufficient or do we need a more specific JIRA describing the change below? It would be good if you or Jasmine could add these comments from this mail thread to the ticket.


- thanks, Binny

Ed Cable

unread,
Nov 10, 2011, 10:23:42 AM11/10/11
to Mifos software development

+1

Jasmine, if you can log a task with details of how to fix this as discussed in this thread, I will try to find a volunteer.

Ed

bankadmin

unread,
Nov 10, 2011, 1:55:23 PM11/10/11
to Mifos software development
We have everything: Jira cases (since 08/Sep/10 ) , group discussions (more then week) , recommendations, reasons, funds, computers, internet....  shortly everything,  but no thousand separator  :-)   

http://mifosforge.jira.com/browse/MIFOS-2082 
http://mifosforge.jira.com/browse/MIFOS-3670

P.S. Can any one fix it in about 10-15  most important pages?

Jasmine sandhu

unread,
Nov 10, 2011, 2:04:26 PM11/10/11
to Mifos software development
On Thu, Nov 10, 2011 at 7:23 AM, Ed Cable <edc...@gmail.com> wrote:

+1

Jasmine, if you can log a task with details of how to fix this as discussed in this thread, I will try to find a volunteer.


Just documented it Ed.
If you can find someone great - I will also get started on this.

Jasmine
 



--
- Climbed Rainier to Raise funds for Asha - please sponsor my climb -
-------------------------------------------------------------------------------------

Jasmine sandhu

unread,
Nov 10, 2011, 2:05:54 PM11/10/11
to Mifos software development
>> P.S. Can any one fix it in about 10-15  most important pages?

I'll get started on this tomorrow Binny. There's no reason I/(we) have to have all the JSP updated at once. I'll see if I can figure out the updates on the pages you pointed out as being incorrect.

Jasmine

- Climbed Rainier to Raise funds for Asha - please sponsor my climb -
-------------------------------------------------------------------------------------

Jasmine sandhu

unread,
Nov 10, 2011, 2:34:00 PM11/10/11
to Mifos software development
Ed,
Just another quick question.


>> Jasmine, if you can log a task with details of how to fix this as discussed in this thread

I logged the work under: http://mifosforge.jira.com/browse/MIFOS-3670
If you meant something else when you asked me to log the task with details -- let me know and I'll fix it. 


>> If you can find someone great - I will also get started on this.

And I have trouble communicating sometimes. What I meant is that I will also work on this, but if someone has more time availability and a clever solution, please by all means, go for it  and educate me the process as well  :-)

Jasmine


2011/11/10 Jasmine sandhu <sandhu....@gmail.com>

Jakub Sławiński

unread,
Nov 11, 2011, 4:37:32 AM11/11/11
to mifos-d...@lists.sourceforge.net

Hi,

can you prepare this list of 10-15 most important pages?

Moreover, if someone is working on MIFOS-3670, please assign it to
yourself and after fixing several pages commit those changes/attach a
patch to the issue.

I have changed the fixVersion to 2.2.2 to have this issue on horizon.


Regards,
Jakub.

On 10.11.2011 19:55, bankadmin wrote:
> We have everything: Jira cases (since 08/Sep/10) , group discussions


> (more then week) , recommendations, reasons, funds, computers,
> internet.... shortly everything, but no thousand separator :-)
>
> http://mifosforge.jira.com/browse/MIFOS-2082
> http://mifosforge.jira.com/browse/MIFOS-3670
>

> *P.S. Can any one fix it in about 10-15 most important pages? *

Udai Gupta

unread,
Nov 11, 2011, 4:53:40 AM11/11/11
to Mifos software development
Implementing it in the backend will probably be much difficult.

A quick and easy way to do this will be create a jquery event
(key/submit) listener function and include that into head.jsp/ftl.

this is what need to be done in that script. Bind the key press event
listener to any input field, on key press if the value entered in the
input field is purely numbering then parse that value to number in js
and apply client side localization (or parsing) to add thousand
separator, on click submit parse those field again and remove thousand
separator right before they submit.

Here is a live example people using it.
http://www.apnapaisa.com/loan/home-loan-india/comparison.html

This way we isolate this issue in one js function. We should be able
to enable disable this js based on config also.

Udai

Jakub Sławiński

unread,
Nov 11, 2011, 4:57:58 AM11/11/11
to mifos-d...@lists.sourceforge.net

Hi Udai,

great idea - but it will solve only input fields, right?


Regards,
Jakub.

Udai Gupta

unread,
Nov 11, 2011, 5:06:31 AM11/11/11
to Mifos software development
Yes, I thought the problem was entering wrong data, wan't sure about
reading wrong data.

But if that's the case you can put span/div around those numbers in UI
and apply this function onload.

Udai

2011/11/11 Jakub Sławiński <jslaw...@soldevelo.com>:

Jakub Sławiński

unread,
Nov 11, 2011, 5:37:03 AM11/11/11
to mifos-d...@lists.sourceforge.net
OK, but applying span/div around those numbers is the same amount of
work as adding fmt:formatNumber tags. Someone has to review jsp pages
and add those new tags in a proper places.


Regards,
Jakub.

Binny Gopinath

unread,
Nov 11, 2011, 5:50:11 AM11/11/11
to Mifos software development
Hi Jakub,

Here is the list of most important pages:

collection sheet entry page
collection sheet preview
loan creation page
Loan Details page (Account summary section, Performance history section)
View Payment Schedule page
View Original Schedule page
View Installment Details page
View All account activity page (Loan and Savings)
View Transaction History page (Loan and Savings)
Savings Details page (Account details and performance history sections)
center details page (Total loan portfolio, total savings)
Group details page (Amount of last Group Loan, Avg individual Loan size, Total Loan portfolio, Portfolio at risk, Total Savings)
Client details page (Outstanding balance, amount due, savings balance, Performance history fields etc.)

Thanks
Binny

2011/11/11 Jakub Sławiński <jslaw...@soldevelo.com>



--
Thanks and Regards
Binny Gopinath Sreevas
+91-98861 39498
Skype: binny.gopinath

Udai Gupta

unread,
Nov 11, 2011, 6:27:08 AM11/11/11
to Mifos software development
> OK, but applying span/div around those numbers is the same amount of
> work as adding fmt:formatNumber tags. Someone has to review jsp pages
> and add those new tags in a proper places.

Agree, I probably just misunderstood the problem, assuming it was just
about entering data.

Ed Cable

unread,
Nov 11, 2011, 1:53:54 PM11/11/11
to Mifos software development

Udai,

Andrew Hagner and a colleague, Jon were going to try and start work in initial approach this weekend. If he should take the second alternate approach, I'll let him discuss that on the list.

Ed

George IBERIA

unread,
Nov 14, 2011, 4:33:20 AM11/14/11
to mifosde...@googlegroups.com, Mifos software development
Dear Jasmine,

Anay update on this issue?

Thank you. George.  


Andrew Hagner

unread,
Nov 14, 2011, 1:01:13 PM11/14/11
to mifosde...@googlegroups.com, Mifos software development, Jon Thompson, Gregory Hislop
All,

 I spoke with Ed today about the possible solutions mentioned so far. I think the best approach  might be to use the java-script Udai mentioned for inputting, and use either the span/div approach or the approach Jasmine mentioned in the issue's work log in order to display the formatted values.

I will be starting to work on this some today and tomorrow, along with my colleague Jon. And if any option becomes clearly better than another, we'll let you know which one.

If anyone else has suggestions let me know,

-Andrew

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
Mifos-developer mailing list
mifos-d...@lists.sourceforge.net
Unsubscribe or change settings at:
https://lists.sourceforge.net/lists/listinfo/mifos-developer



--
Andrew Hagner
B.S. Software Engineering
Drexel University, Class of 2015

George IBERIA

unread,
Nov 14, 2011, 11:23:07 PM11/14/11
to mifosde...@googlegroups.com, Mifos software development, Jon Thompson
Thank you sir. We are looking forward to hear from you. 
Please be concentrated on the pages listed above.

George

Andrew Hagner

unread,
Nov 15, 2011, 1:35:52 PM11/15/11
to mifosde...@googlegroups.com, Mifos software development
Just wondering, but is there a sample database that we could download to use for testing? It would definitely help save some time.

Andrew

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
Mifos-developer mailing list
mifos-d...@lists.sourceforge.net
Unsubscribe or change settings at:
https://lists.sourceforge.net/lists/listinfo/mifos-developer

George IBERIA

unread,
Nov 15, 2011, 2:04:51 PM11/15/11
to mifosde...@googlegroups.com, Mifos software development
we will send it tomorrow.  But i think you can do it with demo database too. 

Keith Woodlock

unread,
Nov 15, 2011, 5:09:06 PM11/15/11
to mifosde...@googlegroups.com, Mifos software development
Andrew,

Theres a database dump of the 'acceptance test data' that can be useful to use:

its called acceptance_test_dump.sql and can be found in mifos-db module.

Typically though I just build up mifos from scratch:

1. create blank mifos schema
2. apply base-schema.sql
3. aply base-data.sql
4. execute the init_mifos_password.sql so can login with mifos/testmifos
5. apply the following which can be found in integration-test-data.sql

-- Entity: Salutation
insert into lookup_value(lookup_id,entity_id,lookup_name) values
(47, 15, 'Salutation-Mr'),
(48, 15, 'Salutation-Mrs'),
(228, 15, 'Salutation-Ms');

insert into lookup_value_locale(lookup_value_id,locale_id,lookup_id,lookup_value)
values
(93,1,47,'Mr'),
(95,1,48,'Mrs'),
(438,1,228,'Ms');

This is the minimal setup for mifos.

Then you can just 'turn the clock back on your computer' and start
creating loan products, center/group/client hierarchys, and loans etc

Clearly it can take a bit of time to build up your own demo instance
but its worth it. as you can take a dump of this and always go back to
your demo instance when need be.

Keith.

On Tue, Nov 15, 2011 at 7:04 PM, George IBERIA <bank...@gmail.com> wrote:
> we will send it tomorrow.  But i think you can do it with demo database
> too.
>

Andrew Hagner

unread,
Nov 15, 2011, 5:12:29 PM11/15/11
to Mifos software development
Thanks Keith!

George IBERIA

unread,
Nov 17, 2011, 6:13:13 AM11/17/11
to mifosde...@googlegroups.com, Mifos software development
Dear Andrew & Jasmine,

Any updated on this issue? Could you please give us even 1 page with the changes and explain the task?  is it possible for 20% techies to do those changes? ( without IDE) ?

Thanks and sorry for asking this .... just trying to prepare nice presentation for potential client. 
george

Andrew Hagner

unread,
Nov 17, 2011, 9:31:07 AM11/17/11
to mifosde...@googlegroups.com, Mifos software development
George,

I'm not sure how far Jasmine has got, but I should be able to give you at least one page done by the end of today. 

Andrew

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d

Mifos-developer mailing list
mifos-d...@lists.sourceforge.net
Unsubscribe or change settings at:
https://lists.sourceforge.net/lists/listinfo/mifos-developer

George IBERIA

unread,
Nov 17, 2011, 10:45:39 AM11/17/11
to mifosde...@googlegroups.com, Mifos software development
Thank you very much Andrew.

Jasmine sandhu

unread,
Nov 17, 2011, 12:15:18 PM11/17/11
to Mifos software development, mifosde...@googlegroups.com
George,

I have not had a chance to do any work on this issue. Apologies for that, but just don't have the time right now. I'll post if I make any progress.

Jasmine
- Climbed Rainier to Raise funds for Asha - please sponsor my climb -
-------------------------------------------------------------------------------------

bankadmin

unread,
Nov 17, 2011, 1:29:52 PM11/17/11
to mifosde...@googlegroups.com, Jasmine sandhu, Mifos software development
Thanks Jasmine.  We are looking forward to Andrew's e-mail. He promised us at least 1 page today. 

George

Andrew Hagner

unread,
Nov 17, 2011, 3:07:57 PM11/17/11
to Mifos software development
All,

 If anyone could help me find the jsp page that goes with the collection sheet entry page & the preview page for collection sheet entry that would be a big help. I can't seem to pinpoint that exact file, which is where the formatting would be as well.

Also, Jon T. managed to get an input plugin running however he had some trouble creating a patch, and when tested on my version it didn't quite work. He won't be able to look at it again until this weekend, sorry. 

Andrew Hagner

unread,
Nov 17, 2011, 4:11:40 PM11/17/11
to Mifos software development
Binny & George,

Unfortunately things are taking me longer than expected so I probably won't have the chance to get a working patch/page to you today. I'll let you know as soon as we have something.

Also a quick question, I noticed that Udai's example (http://www.apnapaisa.com/loan/home-loan-india/comparison.html) puts commas every 2 decimal places, it that how you want it to work? I just want to make sure, I'm used to doing every 3 decimal places so its just something new to me. 

Andrew

Keith Woodlock

unread,
Nov 17, 2011, 6:03:11 PM11/17/11
to Mifos software development
Andrew.

A quick way of finding what jsp file represents the page you are
looking at on mifos is to 'inspect' the page using firefox or just
view source and find the span on the page with id="page.id" and
checkout what value is against the 'title' attribute.

In this case its 'BulkEntry'

you can then search eclipse for files of type *.jsp with text 'title="BulkEntry'

Using this approach for all pages should quickly get you to the .jsp
page used in presentation.

Keith.

Keith Woodlock

unread,
Nov 17, 2011, 6:06:46 PM11/17/11
to Mifos software development
Andrew,

Whatever approach you use whether its the simple <fmt:formatNumber
value="${variable}" type="number" /> indicated by Jakub or the JQuery
approach indicated by Udai, it has to be able to work for different
'locales', so no hard coding to any praticular number format
(english/american/ etc)

Keith.

George IBERIA

unread,
Nov 17, 2011, 11:56:37 PM11/17/11
to mifosde...@googlegroups.com, Mifos software development

I have a dream that one day this nation will rise up and live out the true meaning of its creed: "Numbers are well formatted with thousand separator "

I have a dream that one day on the red hills of Georgia will be able to see amounts without magnifiers;

I have a dream that one day even the  balance sheet will be displayed with formatted amounts.

I have a dream that my 2  little children will one day live in a nation where they will not be judged by having thousand separators.

I have a dream today!

george with low case and many dreams

 

Andrew Hagner

unread,
Nov 18, 2011, 9:36:25 AM11/18/11
to Mifos software development
Keith,

 Thanks for the help! I realized that yesterday although a bit late to help me out much. As for the locales, is there a list somewhere of how each locale's currency should be formatted in terms of commas, decimals, etc...? If not I can try to put one together. And there is a variable/setting in Mifos that holds the locale, correct? So it would/should just be a matter of having a set of rules for formatting that corresponds to which locale/currency is in use.

- Andrew

Jakub Sławiński

unread,
Nov 18, 2011, 9:43:38 AM11/18/11
to mifos-d...@lists.sourceforge.net

Hi Andrew,

why do you need such list? Are you trying to do something more than
changing appropriate c:out tags to fmt:formatNumber ones?


Regards,
Jakub.

Udai Gupta

unread,
Nov 18, 2011, 10:14:21 AM11/18/11
to Mifos software development
Jakub,

> why do you need such list? Are you trying to do something more than
> changing appropriate c:out tags to fmt:formatNumber ones?

It's a good question, the actual formatting of money/numbers is done
based on locale.

https://github.com/mifos/head/blob/master/appdomain/src/main/java/org/mifos/framework/util/LocalizationConverter.java

Andrew,

We don't support Localization of numbers in Mifos, so the idea would
be just have English numbers with thousand separator based on locale
(or configuration). Apart from backend method to format numbers, you
can create the JS where the JS initialization takes the parameter to
get thousand or tens separator, it would be good if you spend more
time about how you would implement this without actually making to
much changes in the backend.

Code for collectionsheet.
https://github.com/mifos/head/blob/master/application/src/main/java/org/mifos/application/collectionsheet/struts/tags/BulkEntryTag.java
https://github.com/mifos/head/blob/master/application/src/main/java/org/mifos/application/collectionsheet/struts/uihelpers/BulkEntryDisplayHelper.java
https://github.com/mifos/head/blob/master/application/src/main/resources/META-INF/resources/pages/application/collectionsheet/jsp/bulkentry.jsp
(form)
https://github.com/mifos/head/blob/master/application/src/main/resources/META-INF/resources/pages/application/collectionsheet/jsp/bulkentry_preview.jsp
https://github.com/mifos/head/blob/master/application/src/main/resources/META-INF/resources/pages/application/collectionsheet/jsp/bulkentryconfirmation.jsp

Cheers,
Udai

Keith Woodlock

unread,
Nov 18, 2011, 11:20:46 AM11/18/11
to Mifos software development
Andrew,

I guess the advantage of the approach that jakub said (using jsp tag
lig) is that you should get that for free.

solving it for display is first step, then you can step on and make
sure it works for input fields (although i never enter commas when
typing out a number!)

keith.

bankadmin

unread,
Nov 18, 2011, 11:41:47 AM11/18/11
to mifosde...@googlegroups.com, Keith Woodlock, Mifos software development
Thank you very mach Jakub, Keith and Andrew,

Just to clarify: typical International or English (US or UK does not
matter ) standard will be OK for now.
We just want to see: 123,123,123.12 ( or 123,123,123)
instead of : 123123123.12 ( or 123123123)

George

>>>> Binny& George,


>>>> Unfortunately things are taking me longer than expected so I probably
>>>> won't
>>>> have the chance to get a working patch/page to you today. I'll let you
>>>> know
>>>> as soon as we have something.
>>>> Also a quick question, I noticed that Udai's example
>>>> (http://www.apnapaisa.com/loan/home-loan-india/comparison.html) puts
>>>> commas
>>>> every 2 decimal places, it that how you want it to work? I just want to
>>>> make
>>>> sure, I'm used to doing every 3 decimal places so its just something new
>>>> to
>>>> me.
>>>> Andrew
>>>> On Thu, Nov 17, 2011 at 3:07 PM, Andrew Hagner<andre...@gmail.com>
>>>> wrote:
>>>>> All,
>>>>> If anyone could help me find the jsp page that goes with the
>>>>> collection

>>>>> sheet entry page& the preview page for collection sheet entry that

>>>>>>>> Dear Andrew& Jasmine,

Andrew Hagner

unread,
Nov 25, 2011, 1:40:46 PM11/25/11
to Mifos software development
All,

While Jon's been working on the .ftl pages and formatting the input, I've still been looking at the .jsp pages and how to fix inputting & displaying commas on those. 

At least for the 'Enter Collection Sheet Data' process, the input elements call numbersOnly(this,event) which only lets you enter numerical values for them. Altering that function to allow commas should partially fix the issue. I'll then need to find where the values are submitted and make sure the commas are stripped away before being processed.

Next, in order to display them correctly, like on the preview pages, I believe its just a matter of modifying the Money class's  toString() method, so that it formats the value based on locale. I didn't see a way to do formatting for these values right in the .jsp because of how the pages are generated. If there is a way, please point it out to me, but from what I looked over in the following files, the numbers come right from the Money.class rather than a variable that can be formatted in a .jsp.

See: 
BulkEntry_preview.jsp  - Lines 201-205
BulkEntryTag.java and BulkEntryTagUIHelper.java and BulkEntryDisplayHelper.java
Money.java - Lines 256-270, particularly Line 262

I'll be working on it for about 2-3 more hours today, mainly messing with the Money.toString() method to see what I can do.

- Andrew

Andrew Hagner

unread,
Nov 25, 2011, 2:11:04 PM11/25/11
to Mifos software development
Here's an example of a possible alternate to the Money.toString() method that might work, however I'm not sure if its appropriate for all the places the money class is used. It uses the Locale parameter to automatically format the double value to the correct currency format.

Jasmine Sandhu

unread,
Dec 4, 2011, 1:25:36 AM12/4/11
to Mifos software development
Hi All,

I was revisiting this today and ran into this same problem for the collectionsheetentry pages as Andrew mentioned. That's definitely trickier.

However, I did find that I could update 3 of the JSP pages that handle previewing of loan product data: CreateLoanProductPreview.jsp, EditLoanProductPreview.jsp, LoanProductDetails.jsp.

Attached is the patch for these - it is generated against the g-release branch.

With this patch, thousand separators show up correctly for following cases:
(1) previewing the loan after a new loan is defined
(2) previewing the loan if an existing loan is edited.
(3) when viewing the details of an existing loan product

For LoanProductDetails.jsp I used type="currency" and it shows up as pounds because I guess the locale is GB_En. For the other pages I simply used type="number".
I tested it against the 3 options for calculating the loans and installments and things looked fine.

<Andrew> Your videos for setting up mifos dev environment with all the steps were incredibly helpful - great work! I was up and going in 1 evening.

You asked about how one knows the JSP pages associated with the URL. The legacy mifos code used Struts for the framework and JSP for the views. The framework config files define how the controllers are hooked up to the views. These config files are located under: head/application/src/main/resources/META-INF/resources/WEB-INF/*struts*.xml

They define which jsp pages are displayed based on the URL. As an example, check out the productdefinition-structs-config.xml which shows the actions (view pages) associated with /loanproductaction.do?...

That's my rough understanding of it, here's more info: http://struts.apache.org/1.x/faqs/works.html

Regards,
Jasmine
0001-FIXED-3670-for-3-loan-pages.patch

Jasmine Sandhu

unread,
Dec 4, 2011, 1:41:59 AM12/4/11
to Mifos software development
>> For LoanProductDetails.jsp I used type="currency" and it shows up as pounds because I guess the locale is GB_En. For the other pages I simply used type="number".
>> I tested it against the 3 options for calculating the loans and installments and things looked fine.

From Udai's comment about not supporting localization for numbers, I suppose all these should be type="number". Is that correct?

It is easier to set them all the "number" than to figure out which ones are "currency" but I had already done this one so figured I'd leave it and ask what is desirable. I suppose we probably use mifos in the english language for a lot of countries outside the UK so perhaps type should be number as opposed to currency otherwise the amounts will show up with the pound symbol. Better to ask how it should be rather than to make my own presumptions and assumptions, let me know and I'll fix and provide a new patch.

Keith Woodlock

unread,
Dec 4, 2011, 1:58:53 PM12/4/11
to Mifos software development
Jasmine,

Thanks for the patch.

It applied cleanly and I launched application to inspect changes. As
you have noted the currency in mifos is set in 'configuration' and its
also possible to have 'multiple currencies' where one specific
currency is selected from the 'loan product'. So currency isnt related
to 'user locale' e.g. if i which my preferred locale to spanish, the
currency shouldnt switch to 'euro' etc.

So for now, its enough to just use type="number" for displaying
numbers in mifos.

Thanks again,
Keith.

Jasmine Sandhu

unread,
Dec 4, 2011, 4:09:44 PM12/4/11
to Mifos software development
Thanks Keith. I've fixed the type for LoanProductDetails.jsp to "number" - see attached.
0001-Updated-LoanProductDetails.jsp-so-type-number-as-opp.patch

Keith Woodlock

unread,
Dec 4, 2011, 6:40:29 PM12/4/11
to Mifos software development
Thanks Jasmine, applied and committed.

Jakub Sławiński

unread,
Dec 5, 2011, 6:33:36 AM12/5/11
to mifos-d...@lists.sourceforge.net

Hi,

is anyone looking at the test failures that appeared after applying this
patch?


Regards,
Jakub.

Jasmine Sandhu

unread,
Dec 5, 2011, 12:50:32 PM12/5/11
to Mifos software development
Hi Jakub,

I just looked at the hudson build and it doesn't look like there were any test failures from these patches over the weekend:

http://ci.mifos.org/hudson/job/head-g-release-commit/219/
http://ci.mifos.org/hudson/job/head-g-release-commit/220/

Jasmine


2011/12/5 Jakub Sławiński <jslaw...@soldevelo.com>

iberia

unread,
Dec 5, 2011, 2:07:57 PM12/5/11
to mifosde...@googlegroups.com, Jakub Sławiński, mifos-d...@lists.sourceforge.net, binny.g...@gmail.com
Dear Jakub,

How to do that?
sorry was out 1 week. and just saw your message.
Thanks for your comment.

George

>>>>> still been looking at the .jsp pages and how to fix inputting& displaying

Jakub Sławiński

unread,
Dec 5, 2011, 5:12:17 PM12/5/11
to mifos-d...@lists.sourceforge.net

Hi Jasmine,

acceptance tests are run in a different job. Please look at:

https://ci.mifos.org/hudson/job/head-g-release-secondary/238/
https://ci.mifos.org/hudson/job/head-g-release-secondary/239/


Regards,
Jakub.

Jasmine Sandhu

unread,
Dec 5, 2011, 6:49:28 PM12/5/11
to Mifos software development
Ah - thanks Jakub. From looking at the errors online, looks like errors are because the test is not parsing the formatted numbers correctly.

The errors in parsing currency in the following: https://ci.mifos.org/hudson/job/head-g-release-secondary/238/ have gone away after applying the second patch.

However, I see 8 of the 10 errors after the second patch applied are because it is comparing a float with a comma separated (formatted) text:
java.lang.AssertionError: expected:<1000.0> but was:<1,000>
	at org.testng.Assert.fail(Assert.java:89)
	at org.testng.Assert.failNotEquals(Assert.java:480)
	at org.testng.Assert.assertEquals(Assert.java:118)
	at org.testng.Assert.assertEquals(Assert.java:171)
	at org.testng.Assert.assertEquals(Assert.java:181)
	at org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage.verifyLoanAmountTableTypeSame(LoanProductDetailsPage.java:110)
	at org.mifos.test.acceptance.loan.CreateClientLoanAccountTest.verifyCreatingLoanAccountsOnProductWithLoanCycles(CreateClientLoanAccountTest.java:468)


I will have to spend some time understanding why it is comparing the formatted string with the floating point value - seems like it should be setup to compare two floating point values; but a quick look at the code online tells me I'll need to spend sometime understanding the implementation. I'll look into it this week - may not get to it till Wed or Friday.

And I don't know about the last two errors - will also look into those.

Keith Woodlock

unread,
Dec 6, 2011, 6:29:22 PM12/6/11
to Mifos software development
Jasmine, Jakub,

I made changes so acceptance tests would pass after add 'commas' for
number but there are still two failing tests and I am not sure why
they are failing. Maybe it something you could help look at.

Most of the tests fail due to assertions verify 'number' amounts by
string values.

Keith.

On Mon, Dec 5, 2011 at 11:49 PM, Jasmine Sandhu

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of
discussion for anyone considering optimizing the pricing and packaging model
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/

Jakub Sławiński

unread,
Dec 9, 2011, 10:50:56 AM12/9/11
to mifos-d...@lists.sourceforge.net

I fixed the error that was causing these tests to fail. There was a
stack trace when variable instalments option was enabled. Maybe there
are still other broken edge cases?

Do you have any ideas how to avoid such situations in the future
(unstable main development branch for 5 days)?


Regards,
Jakub.

George IBERIA

unread,
Dec 9, 2011, 3:37:31 PM12/9/11
to mifosde...@googlegroups.com, Mifos software development
Thanks Jakob for your support and work. May I ask you where do you have a test plan ? and how testing process is organized? I am thinking to contribute / participate in this process in future. Thanks.

Udai Gupta

unread,
Dec 10, 2011, 12:47:07 AM12/10/11
to Mifos software development
> Do you have any ideas how to avoid such situations in the future
> (unstable main development branch for 5 days)?

We have clear guidelines about how to deal with broken build.

http://mifosforge.jira.com/wiki/display/RES/How+To+Break+The+Build

1) Revert the changes causing broken build if no one is working on
fixing the build. (check that on mailing list and IRC both)
2) Use hudsonBuild* to check patch stability.

Udai

------------------------------------------------------------------------------
Learn Windows Azure Live! Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for
developers. It will provide a great way to learn Windows Azure and what it
provides. You can attend the event by watching it streamed LIVE online.
Learn more at http://p.sf.net/sfu/ms-windowsazure

ADMIN

unread,
Dec 11, 2011, 3:01:11 PM12/11/11
to mifosde...@googlegroups.com, Mifos software development
Dear Colleagues,

I tested Thousands separator on test server:
http://demo.mifos.org/mifos expecting latest version with Jon's fixes.
See attached screenshot with the result (in savings number is without
separator) . Do I missed something?

George

thsnd.PNG

ADMIN

unread,
Dec 11, 2011, 3:06:26 PM12/11/11
to mifosde...@googlegroups.com, Mifos software development
Same results for http://ci.mifos.org:8085/mifos/
:-(

Jasmine Sandhu

unread,
Dec 12, 2011, 2:06:00 PM12/12/11
to Mifos software development, mifosde...@googlegroups.com
Hi George,

The changes appear correctly for loans and savings on the test server running head/g-release branch: http://ci.mifos.org:8122/mifos/

Here's a savings screenshot: http://static.inky.ws/image/1018/image.jpg

You can test it out on this server. For the 'View Loan Products', it looks like the processing fee does not include the thousand separators - I worked on this so I can look into it. If you see other inconsistencies like this, let us know.

I don't know how the changes make it into the HEAD branch and the demo server; someone else can respond to that; however, you should be able to test the updates on this server in the meantime.


Jasmine


------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for
developers. It will provide a great way to learn Windows Azure and what it
provides. You can attend the event by watching it streamed LIVE online.
Learn more at http://p.sf.net/sfu/ms-windowsazure
Mifos-developer mailing list
mifos-d...@lists.sourceforge.net
Unsubscribe or change settings at:
https://lists.sourceforge.net/lists/listinfo/mifos-developer

Ed Cable

unread,
Dec 16, 2011, 12:28:44 PM12/16/11
to Mifos software development
Jasmine/Jon/Andrew,

Thanks for getting the first patches through and viewable on the test server.

Could you update the JIRA issue with the progress that's been made and the remaining work that's left to do.


Thanks,

Ed

Jasmine Sandhu

unread,
Dec 21, 2011, 12:52:55 PM12/21/11
to Mifos software development
Hi Ed,

On Fri, Dec 16, 2011 at 9:28 AM, Ed Cable <edc...@gmail.com> wrote:
Jasmine/Jon/Andrew,

Thanks for getting the first patches through and viewable on the test server.

Could you update the JIRA issue with the progress that's been made and the remaining work that's left to do.


I've added what's been done on the JSP pages that I edited in the comments section. I haven't gotten to what still needs to be done but will email once I get to it.

Jasmine

 
Reply all
Reply to author
Forward
0 new messages