Reformat and homogenize displaying number

2019-04-05 Thread Nicolas Malin

Hello

I would improve an idea present by Charles STELTZLEN on issue OFBIZ-7532 [1]

Currently when you display a number you have different possibility to 
format it :

 * by ftl with <@ofbizAmount>
 * by widget with 
 * or everywhere with UtilFormatOut.formatDecimalNumber(number, 
template, locale)


Main problem, we haven't a simple solution to homogenize display 
template number by purpose without check each case on source code.
A example, if you display your invoice amount on 3 digits and your order 
amount on 6 digits, you can't use ofbizAmount or accounting-number so 
you do raw call :
 * for invoice: UtilFormatOut.formatDecimalNumber(invoiceAmount, 
'##0.000', locale)
 * for order: UtilFormatOut.formatDecimalNumber(invoiceAmount, 
'##0.00', locale)


on ftl
${Static["org.apache.ofbiz.base.util.UtilFormatOut"].formatDecimalNumber(invoiceAmount, 
'##0.000', locale)}

on widget
    

There is huge cases where we want different displaying template.

For homogenize all I propose to introduce each format template on 
properties that would be use everywhere in ofbiz, example :


 format.properties
     invoice.format=##0.000
         order.format=##0.00

on ftl
     <@ofbizAmount amount=invoice.amount format='invoice'/>
on widget
     

All displaying template pass through new util 
*UtilFormatOut.formatNumber* as generic function to works with a format 
type present on properties. With this idea, you can use on you specific 
source code your own format and override standard ofbiz format.


I will suggest a patch on issue OFBIZ-7532 [1]

I thinks it's important feature to help customization so if you have a 
suggest, your welcome :)


Cheers,
Nicolas

[1] https://issues.apache.org/jira/browse/OFBIZ-7532

--
logoNrd 
Nicolas Malin
The apache way  : *Charity* Apache’s mission 
is providing software for the public good.

informat...@nereide.fr
8 rue des Déportés 37000 TOURS, 02 47 50 30 54

Apache OFBiz |The Apache Way 
|réseau LE 


Re: Supply chain example

2019-04-05 Thread Wolfgang Paul Rauchholz
* The drink manufacturer is your company or a supplier?
* The production and ingredients replenishment for  soft drinks is in
or out of scope?
* Warehousing for soft drinks is in or out of scope?
* Sale of soft drink is in or out of scope?
* The distribution of soft drinks is in or out of scope?
* What information is filled into your supply chain?
* When is this being done?
* How exactly does it relate to your customers?




On Fri, 2019-04-05 at 00:31 -0500, laxman wrote:
> Hi, I want to create an application in which we have soft drink
> manufacture
> company. They will fill the information in our supply chain. and end
> user
> can we get information bases on soft drink number 
> 
> 
> 
> --
> Sent from: http://ofbiz.135035.n4.nabble.com/OFBiz-Dev-f165671.html