Fix bug where the Paid In/Out Dialog was treating cancel the same as ok

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@600258 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Scott Gray
2007-12-02 08:47:23 +00:00
parent 532e8d2d8f
commit ba1dfb8bc7
@@ -18,6 +18,7 @@
*******************************************************************************/
package org.ofbiz.pos.screen;
import java.util.HashMap;
import java.util.ResourceBundle;
import java.util.Enumeration;
import java.util.Hashtable;
@@ -56,6 +57,7 @@ public class PaidInOut extends XPage {
protected DefaultComboBoxModel m_comboModel = null;
protected static PosTransaction m_trans = null;
protected String m_type = null;
protected boolean cancelled = false;
//TODO : make getter and setter for members (ie m_*) if needed (extern calls). For that in Eclipse use Source/Generate Getters and setters
@@ -103,11 +105,16 @@ public class PaidInOut extends XPage {
m_dialog.pack();
m_reasonsCombo.requestFocusInWindow();
m_dialog.showDialog(this);
return UtilMisc.toMap("amount", m_amountEdit.getText(), "reason", (String) m_reasonsCombo.getSelectedItem());
if (cancelled) {
return new HashMap();
} else {
return UtilMisc.toMap("amount", m_amountEdit.getText(), "reason", (String) m_reasonsCombo.getSelectedItem());
}
}
public synchronized void cancel() {
if (wasMouseClicked()) {
if (wasMouseClicked()) {
cancelled = true;
m_dialog.closeDlg();
}
}