From: Udai G. <mai...@gm...> - 2010-02-24 22:02:34
|
Hi Folks, I am working on this issue http://mifosforge.jira.com/browse/MIFOS-1537. The current implementation for this property. - The default value is 7 and its hardcoded because this was the limit in the database. - One can override 7 by using AccountingRules.DigitsBeforeDecimal in configuration file. - This property is not documented, I am not sure if someone is using it for a value like 6 or 5 - It allow more than 7 too which can cause data overflow for amount fields in database - May be it wasn't documented because we didn't wanted to allow user to use it for a value more than 7. Now we have increased the database limit to be able to store up to 17 digits before decimal for amount. There are 3 ways I can think of, 1) Keep the same code, have the hardcoded default 7 and let the user will be able to set more than 7 using AccountingRules.DigitsBeforeDecimal applicationConfiguration.custom.properties behind the curtain. (This would require no change) 2) Move the hardcoded 7 to applicationConfiguration.default.properties and document the use of this property. 3) Remove the AccountingRules.DigitsBeforeDecimal and the ability to configured it behind the curtain and make it hardcoded value like 14. this will change the current behavior of users seeing error on entering amount of more than 7 digits. I can think of a validation for 1 and 2. where we hardcode Max and the Min value for this property and throw an exception for "out of bound" values. The question here is what should be the max and min here. My thought is max should be 14 and min should be 2. Although we can store up to 17 in database I think its better to use a lower value because for totals allowing 17 could make the totals overflow which are using same data limit. I am in favor of approach 2, Thoughts/ Comment/ Vote/ Questions ? Udai |