Commit Graph
12 Commits
Author SHA1 Message Date
SebastianEcomify 8a96462538 Improved: Convert CostService.xml minilang to groovy
(OFBIZ-11595)

Thanks: Sebastian Berg for implementation
2021-02-21 11:38:21 +00:00
Nicolas Malin 4a511be1cc Implemented: Homogenize displaying number with multiple format
(OFBIZ-7532)

To display a number we had different possibilities :
 * on ftl use the template <@ofbizAmount and <@ofbizCurrency
 * by java call a function UtilFormatOut.formatAmount, UtilFormatOut.formatPrice, UtilFormatOut.formatQuantity, etc..
 * by form widget, use <display type=accounting-number for accounting but nothing for other

To simplify and homogenize all, I implemented a number type purpose :
   * default: display a number by default, use when no purpose is present
   * quantity: display a number as a quantity
   * amount: display a number as an amount (like price without currency)
   * spelled: litteral displaying for a number (use on <@ofbizAmount ftl only before)
   * percentage: display a number as a percentage
   * accounting: diplay a number for accounting specific

Each purpose can be associate to a number for displaying it :
   * on ftl <@ofbizNumber number=value format=purpose/>
   * on java UtilFormatOut.formatNumber(value, purpose, delegator, locale)
   * on form widget <display type=number format=purpose/>

The format use by a purpose is define on framework/common/config/number.properties with the template
    .displaying.format = ##0.00

With this, you can surchage a configuration, create your own purpose or surchage only one through entity SystemProperty.

Concerning the backware compatibility: 
 * For the ftl the template <@ofbizAmount is now a link to '<@ofbizNumber format=amount'
 * For java all previous function call UtilFormatOut.formatNumber with the matching purpose
 * For form xml accounting-number is managed as an exection

Last point, display a currency is different that a number, so I didn't refactoring some code for this case (only move properties from general to number for centralize de configuration on the same file)

Thanks Charles Steltzlen to start the refactoring

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1864832 13f79535-47bb-0310-9956-ffa450edef68
2019-08-09 20:37:11 +00:00
Erwan de Ferrieres e268db4a97 Adding a new display type "accouting-number", which allows to display negatives in parentheses
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@937964 13f79535-47bb-0310-9956-ffa450edef68
2010-04-26 08:51:25 +00:00
Jacques Le Roux b9c3ddef08 2d part and end of an effort to remove trailing spaces
[ \t]+$ => "" (empty)
Should be easier to review when committing changes with trailing spaces removed automatically by anyedit or such tool (please refer to http://docs.ofbiz.org/x/mg)

Of course this effort to remove trailing spaces has no functional implications.

Actually, I was doing a 1st commit and as it's long to upload, I got conflicts with r763135
In the meantime I did some refactoring also in *.java and *.groovy files :
){ => ) {
if( => if (
while( => while (
}else => } else
else{ => else {
switch( => switch (
try{ => try {
}catch => } catch
catch( => catch (
}finally{ => } finally {

So these changes are also in this commit, should not be a problem anyway.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@763175 13f79535-47bb-0310-9956-ffa450edef68
2009-04-08 10:54:51 +00:00
Si Chen 46654f1cd0 Allow for different levels of precision for sales invoice and purchase invoice amounts
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@574397 13f79535-47bb-0310-9956-ffa450edef68
2007-09-10 22:53:33 +00:00
Si Chen 5ec84c5704 Set ledger rounding to be 1 digit more than any other financial rounding setting to avoid rounding problems
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@572526 13f79535-47bb-0310-9956-ffa450edef68
2007-09-04 05:15:00 +00:00
David E. Jones 0af991a4e1 A number of fixes/improvements related to handling funny numbers properly using BigDecimal for calculations, and rounding incoming Double values which can be (often are) weird
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@571291 13f79535-47bb-0310-9956-ffa450edef68
2007-08-30 20:08:43 +00:00
Si Chen cb59ee5ba3 Fix rounding issues in general ledger posting routines because they did not have configurable BigDecimal rounding properties.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@570894 13f79535-47bb-0310-9956-ffa450edef68
2007-08-29 18:39:40 +00:00
Jacques Le Roux 64cea174fc This is the change of ASL2 headers in properties files only. Please see comments in another post in dev ML.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@497074 13f79535-47bb-0310-9956-ffa450edef68
2007-01-17 16:49:01 +00:00
Jacopo Cappellato 420a909049 Conversion from MIT to ASL2.0 for the files of the accounting component.
Many thanks to Scott Gray for the patch (Apache OFBIZ-87).

git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@422403 13f79535-47bb-0310-9956-ffa450edef68
2006-07-16 08:10:15 +00:00
Si Chen 59d1e1f523 Changing all rounding modes to round half up because round half even violates the principle of least surprise for casual users and customers, even though it is more precise
git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@419626 13f79535-47bb-0310-9956-ffa450edef68
2006-07-06 17:43:23 +00:00
David E. Jones 94fe6d1cda Initial OFBiz import from revision 7923 of the old svn.ofbiz.org SVN repository.
git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@418498 13f79535-47bb-0310-9956-ffa450edef68
2006-07-01 19:05:20 +00:00