meliani / openconcerto

Automatically exported from code.google.com/p/openconcerto
0 stars 0 forks source link

Can't create invoice with a sum over 1000 #73

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an invoice
2. Add a line with an amount > 1000. E.g. 1200

What is the expected output? What do you see instead?
Total should reflect the changes and allow validation. Instead an exception is 
thrown:

UncaughtException on thread Thread[AWT-EventQueue-0,6,main]

1,200.00 More than one decimal point
org.openconcerto.utils.ExceptionHandler: UncaughtException on thread 
Thread[AWT-EventQueue-0,6,main]
    at org.openconcerto.utils.ExceptionHandler.handle(ExceptionHandler.java:99)
    at org.openconcerto.utils.ExceptionHandler.handle(ExceptionHandler.java:103)
    at org.openconcerto.erp.config.Gestion$2.uncaughtException(Gestion.java:183)
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:981)
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:976)
    at apple.awt.CToolkit$EventQueueExceptionHandler.handle(CToolkit.java:81)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at java.awt.EventDispatchThread.handleException(EventDispatchThread.java:412)
    at java.awt.EventDispatchThread.processException(EventDispatchThread.java:318)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:312)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.NumberFormatException: 1,200.00 More than one decimal point
    at org.openconcerto.utils.GestionDevise.parseLongCurrency(GestionDevise.java:53)
    at org.openconcerto.erp.core.common.ui.DeviseField.getValue(DeviseField.java:220)
    at org.openconcerto.erp.core.common.ui.DeviseField.getValue(DeviseField.java:1)
    at org.openconcerto.utils.checks.EmptyObjFromVO.isEmpty(EmptyObjFromVO.java:73)
    at org.openconcerto.utils.checks.EmptyObjHelper.isEmpty(EmptyObjHelper.java:39)
    at org.openconcerto.sql.sqlobject.itemview.VWRowItemView.isEmpty(VWRowItemView.java:109)
    at org.openconcerto.sql.element.BaseSQLComponent.getValidState(BaseSQLComponent.java:511)
    at org.openconcerto.sql.element.BaseSQLComponent.fireValidChange(BaseSQLComponent.java:487)
    at org.openconcerto.sql.element.BaseSQLComponent.emptyOrValidChanged(BaseSQLComponent.java:447)
    at org.openconcerto.sql.element.BaseSQLComponent$5.emptyChange(BaseSQLComponent.java:415)
    at org.openconcerto.utils.checks.EmptyChangeSupport.fireEmptyChange(EmptyChangeSupport.java:43)
    at org.openconcerto.utils.checks.EmptyObjHelper$1.emptyChange(EmptyObjHelper.java:33)
    at org.openconcerto.utils.checks.EmptyChangeSupport.fireEmptyChange(EmptyChangeSupport.java:43)
    at org.openconcerto.utils.checks.EmptyObjFromVO.valueChanged(EmptyObjFromVO.java:87)
    at org.openconcerto.utils.checks.EmptyObjFromVO.access$0(EmptyObjFromVO.java:86)
    at org.openconcerto.utils.checks.EmptyObjFromVO$2.propertyChange(EmptyObjFromVO.java:66)
    at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
    at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
    at org.openconcerto.ui.valuewrapper.ValueChangeSupport.fireValueChange(ValueChangeSupport.java:56)
    at org.openconcerto.ui.valuewrapper.format.FormatValueWrapper.setSelfValue(FormatValueWrapper.java:170)
    at org.openconcerto.ui.valuewrapper.format.FormatValueWrapper.textChanged(FormatValueWrapper.java:164)
    at org.openconcerto.ui.valuewrapper.format.FilterFormatValueWrapper$1.update(FilterFormatValueWrapper.java:53)
    at org.openconcerto.utils.text.SimpleDocumentListener.removeUpdate(SimpleDocumentListener.java:51)
    at javax.swing.text.AbstractDocument.fireRemoveUpdate(AbstractDocument.java:243)
    at javax.swing.text.AbstractDocument.handleRemove(AbstractDocument.java:608)
    at javax.swing.text.AbstractDocument$DefaultFilterBypass.replace(AbstractDocument.java:3100)
    at org.openconcerto.utils.text.DocumentFilterList$ChainedFilterBypass.replace(DocumentFilterList.java:177)
    at org.openconcerto.ui.filters.FormatFilter.replace(FormatFilter.java:114)
    at org.openconcerto.utils.text.DocumentFilterList$ChainedFilterBypass.replace(DocumentFilterList.java:179)
    at org.openconcerto.utils.text.DocumentFilterList.replace(DocumentFilterList.java:132)
    at javax.swing.text.AbstractDocument.replace(AbstractDocument.java:647)
    at javax.swing.text.JTextComponent.setText(JTextComponent.java:1693)
    at org.openconcerto.erp.core.common.ui.TotalPanel.clearTextField(TotalPanel.java:401)
    at org.openconcerto.erp.core.common.ui.TotalPanel.updateTotal(TotalPanel.java:426)
    at org.openconcerto.erp.core.common.ui.TotalPanel.tableChanged(TotalPanel.java:389)
    at org.openconcerto.sql.view.list.RowValuesTableModel.fireTableChanged(RowValuesTableModel.java:704)
    at org.openconcerto.sql.view.list.RowValuesTableModel.setValueAt(RowValuesTableModel.java:234)
    at javax.swing.JTable.setValueAt(JTable.java:2704)
    at javax.swing.JTable.editingStopped(JTable.java:4706)
    at javax.swing.AbstractCellEditor.fireEditingStopped(AbstractCellEditor.java:125)
    at javax.swing.AbstractCellEditor.stopCellEditing(AbstractCellEditor.java:68)
    at org.openconcerto.erp.core.common.ui.DeviseNumericCellEditor.stopCellEditing(DeviseNumericCellEditor.java:114)
    at javax.swing.plaf.basic.BasicTableUI$Actions.actionPerformed(BasicTableUI.java:469)
    at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1645)
    at javax.swing.JComponent.processKeyBinding(JComponent.java:2859)
    at javax.swing.JTable.processKeyBinding(JTable.java:5241)
    at javax.swing.JComponent.processKeyBindings(JComponent.java:2905)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2822)
    at java.awt.Component.processEvent(Component.java:6191)
    at java.awt.Container.processEvent(Container.java:2083)
    at java.awt.Component.dispatchEventImpl(Component.java:4776)
    at java.awt.Container.dispatchEventImpl(Container.java:2141)
    at java.awt.Component.dispatchEvent(Component.java:4604)
    at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1856)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:722)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1000)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:865)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:686)
    at java.awt.Component.dispatchEventImpl(Component.java:4648)
    at java.awt.Container.dispatchEventImpl(Container.java:2141)
    at java.awt.Window.dispatchEventImpl(Window.java:2489)
    at java.awt.Component.dispatchEvent(Component.java:4604)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:717)
    at java.awt.EventQueue.access$400(EventQueue.java:82)
    at java.awt.EventQueue$2.run(EventQueue.java:676)
    at java.awt.EventQueue$2.run(EventQueue.java:674)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:690)
    at java.awt.EventQueue$3.run(EventQueue.java:688)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:687)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    ... 5 more

What version of the product are you using? On what operating system?
In 1.3b4. OSX 10.8.2

Please provide any additional information below.
My OS is configured in english, maybe that's why it uses a comma to separate 
thousands.

Original issue reported on code.google.com by adans...@gmail.com on 24 Sep 2013 at 10:35

GoogleCodeExporter commented 9 years ago
I fixed it by setting the environment locale on the command line:
LC_ALL=fr_FR.UTF-8 open 
/Applications/OpenConcerto-1.3b4-multiposte-mac/OpenConcerto\ 
\(multiposte\).app 

So I guess this should be changed to: "openconcerto expects French locale to 
work properly"

Original comment by adans...@gmail.com on 3 Oct 2013 at 11:15