svn commit: r600258 - /ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r600258 - /ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java

lektran
Author: lektran
Date: Sun Dec  2 00:47:23 2007
New Revision: 600258

URL: http://svn.apache.org/viewvc?rev=600258&view=rev
Log:
Fix bug where the Paid In/Out Dialog was treating cancel the same as ok

Modified:
    ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java

Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java?rev=600258&r1=600257&r2=600258&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java (original)
+++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java Sun Dec  2 00:47:23 2007
@@ -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 @@
     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 @@
         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();
         }
     }