You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2006/12/05 12:10:01 UTC

svn commit: r482594 - in /incubator/ofbiz/trunk/specialpurpose/pos: screens/default/dialog/ src/org/ofbiz/pos/screen/

Author: jleroux
Date: Tue Dec  5 03:10:00 2006
New Revision: 482594

URL: http://svn.apache.org/viewvc?view=rev&rev=482594
Log:
Replace previous version of Paid In/Out : unversionned files
+ XFocusDialog for future tries

Added:
    incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidIn.properties   (with props)
    incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidInOut.xml   (with props)
    incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidIn_fr.properties   (with props)
    incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidOut.properties   (with props)
    incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidOut_fr.properties   (with props)
    incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java   (with props)
    incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/XFocusDialog.java   (with props)

Added: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidIn.properties
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidIn.properties?view=auto&rev=482594
==============================================================================
--- incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidIn.properties (added)
+++ incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidIn.properties Tue Dec  5 03:10:00 2006
@@ -0,0 +1,3 @@
+Banking=Banking during the day
+ChangeAdded=Change added to Till's float
+PettyCashIn=Petty Cash Paid into Till

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidIn.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidIn.properties
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidIn.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidInOut.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidInOut.xml?view=auto&rev=482594
==============================================================================
--- incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidInOut.xml (added)
+++ incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidInOut.xml Tue Dec  5 03:10:00 2006
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2001-2006 The Apache Software Foundation
+    
+    Licensed under the Apache License, Version 2.0 (the "License"); you may not
+    use this file except in compliance with the License. You may obtain a copy of
+    the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+    License for the specific language governing permissions and limitations
+    under the License.
+-->
+<XPage class="net.xoetrope.swing.XDialog" resource="">
+    <Components>
+        <Panel name="InOutPanel" x="0" y="0" w="680" h="150" style="menu">
+            <Label name="amoutLabel" x="20" y="30" w="100" h="40" content="AmountInOut" style="editAndList"/>
+            <Edit name="amountEdit"  x="120" y="20" w="300" h="40" style="editAndList"/>
+            <Label name="reasonLabel" x="20" y="90" w="100" h="40" content="ReasonInOut" style="editAndList"/>                
+            <ComboBox name="ReasonsCombo" x="120" y="80" w="300" h="40" editable="true" style="editAndList"/>
+            <Button name="BtnCancel" x="460" y="20" w="180" h="40" content="Cancel" style="dialogButton"/>
+            <Button name="BtnOk" x="460" y="80" w="180" h="40" content="Ok" style="dialogButton"/>
+        </Panel>
+    </Components>
+</XPage>
\ No newline at end of file

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidInOut.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidInOut.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidInOut.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidIn_fr.properties
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidIn_fr.properties?view=auto&rev=482594
==============================================================================
--- incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidIn_fr.properties (added)
+++ incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidIn_fr.properties Tue Dec  5 03:10:00 2006
@@ -0,0 +1,3 @@
+Banking=Op\u00E9ration banquaire
+ChangeAdded=Change added to Till's float
+PettyCashIn=Entr\u00E9e d'esp\u00E8ces dans la caisse

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidIn_fr.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidIn_fr.properties
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidIn_fr.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidOut.properties
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidOut.properties?view=auto&rev=482594
==============================================================================
--- incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidOut.properties (added)
+++ incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidOut.properties Tue Dec  5 03:10:00 2006
@@ -0,0 +1,2 @@
+Banking=Banking during the day
+PettyCashOut=Petty Cash out

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidOut.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidOut.properties
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidOut.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidOut_fr.properties
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidOut_fr.properties?view=auto&rev=482594
==============================================================================
--- incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidOut_fr.properties (added)
+++ incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidOut_fr.properties Tue Dec  5 03:10:00 2006
@@ -0,0 +1,2 @@
+Banking=Op\u00E9ration banquaire
+PettyCashOut=Sortie d'esp\u00E8ces de la caisse

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidOut_fr.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidOut_fr.properties
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidOut_fr.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java?view=auto&rev=482594
==============================================================================
--- incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java (added)
+++ incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java Tue Dec  5 03:10:00 2006
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2001-2006 The Apache Software Foundation
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package org.ofbiz.pos.screen;
+
+import java.util.ResourceBundle;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.ListSelectionModel;
+
+import net.xoetrope.swing.XButton;
+import net.xoetrope.swing.XDialog;
+import net.xoetrope.swing.XEdit;
+import net.xoetrope.swing.XLabel;
+import net.xoetrope.swing.XComboBox;
+import net.xoetrope.xui.XPage;
+
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilProperties;
+import org.ofbiz.pos.PosTransaction;
+
+
+public class PaidInOut extends XPage {
+
+    /**
+     * To allow creating or choising a reason for a PAID IN or OUT 
+     */
+    public static final String module = PaidInOut.class.getName();
+    protected static PosScreen m_pos = null;
+    protected XDialog m_dialog = null;
+    protected XLabel m_amoutLabel = null;    
+    protected XEdit m_amountEdit = null;
+    protected XLabel m_reasonLabel = null;
+    static protected Hashtable m_reasonMap = new Hashtable();
+    protected XComboBox m_reasonsCombo = null;
+    protected XButton m_cancel = null;
+    protected XButton m_ok = null;
+    protected DefaultComboBoxModel m_comboModel = null; 
+    protected static PosTransaction m_trans = null;
+    protected String m_type = null; 
+
+    //TODO : make getter and setter for members (ie m_*) if needed (extern calls). For that in Eclipse use Source/Generate Getters and setters
+
+    public PaidInOut(PosTransaction trans, PosScreen page, String type) {
+        m_trans = trans;
+        m_pos = page;
+        m_type = type;
+    }
+
+    public Map openDlg() {
+        m_dialog = (XDialog) pageMgr.loadPage(m_pos.getScreenLocation() + "/dialog/PaidInOut");
+        m_amountEdit = (XEdit) m_dialog.findComponent("amountEdit");
+        m_reasonsCombo = (XComboBox) m_dialog.findComponent("ReasonsCombo");
+
+        m_cancel = (XButton) m_dialog.findComponent("BtnCancel");
+        m_ok = (XButton) m_dialog.findComponent("BtnOk");
+        m_amoutLabel = (XLabel) m_dialog.findComponent("amoutLabel");        
+        m_reasonLabel = (XLabel) m_dialog.findComponent("reasonLabel");
+        addMouseHandler(m_cancel, "cancel");
+        addMouseHandler(m_ok, "verify");
+
+        m_comboModel = new DefaultComboBoxModel();
+        ResourceBundle reasons = null;
+        Enumeration reasonsKeys = null; 
+        
+        if (m_type == "IN") {
+            m_dialog.setCaption(UtilProperties.getMessage("pos", "PaidInTitle", Locale.getDefault()));
+            reasons = ResourceBundle.getBundle(m_pos.getScreenLocation() + "/dialog/PaidIn", Locale.getDefault());
+            reasonsKeys = reasons.getKeys();
+        }
+        else { // OUT
+            m_dialog.setCaption(UtilProperties.getMessage("pos", "PaidOutTitle", Locale.getDefault()));
+            reasons = ResourceBundle.getBundle(m_pos.getScreenLocation() + "/dialog/PaidOut", Locale.getDefault());
+            reasonsKeys = reasons.getKeys();
+        }
+            
+        while (reasonsKeys.hasMoreElements()) {
+            String key = (String)reasonsKeys.nextElement();
+            String val = reasons.getString(key);
+            m_comboModel.addElement(val);
+        }
+        m_reasonsCombo.setModel(m_comboModel);
+        m_reasonsCombo.setToolTipText(UtilProperties.getMessage("pos", "CreateOrChooseReasonInOut", Locale.getDefault()));
+
+        m_dialog.pack();
+        m_reasonsCombo.requestFocusInWindow();
+        m_dialog.showDialog(this);
+        return UtilMisc.toMap("amount", m_amountEdit.getText(), "reason", (String) m_reasonsCombo.getSelectedItem());        
+    }
+
+    public synchronized void cancel() {
+        if (wasMouseClicked()) {            
+            m_dialog.closeDlg();
+        }
+    }
+
+    public synchronized void verify() {
+        if (wasMouseClicked()) {
+            String amount = m_amountEdit.getText();
+            String reason = (String) m_reasonsCombo.getSelectedItem();
+            if (null != amount && amount.length() > 0 && null != reason && reason.length() > 0 ) {                
+                m_dialog.closeDlg();
+            }
+        }
+    }
+}
\ No newline at end of file

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/XFocusDialog.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/XFocusDialog.java?view=auto&rev=482594
==============================================================================
--- incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/XFocusDialog.java (added)
+++ incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/XFocusDialog.java Tue Dec  5 03:10:00 2006
@@ -0,0 +1,60 @@
+///*
+// * Copyright 2001-2006 The Apache Software Foundation
+// * 
+// * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// * use this file except in compliance with the License. You may obtain a copy of
+// * the License at
+// * 
+// * http://www.apache.org/licenses/LICENSE-2.0
+// * 
+// * Unless required by applicable law or agreed to in writing, software
+// * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// * License for the specific language governing permissions and limitations
+// * under the License.
+// */
+//package org.ofbiz.pos.screen;
+//
+//import javax.swing.SwingUtilities;
+//import java.awt.Component;
+//import net.xoetrope.swing.XEdit;
+//import net.xoetrope.swing.XDialog;
+//
+//import org.ofbiz.base.util.Debug;
+//
+//public class XFocusDialog extends XDialog {
+//    
+//    protected XEdit m_focused = null;
+//
+//    public XFocusDialog() {
+//        super();
+//    }
+//    
+//    public void pageActivated() {
+//        super.pageActivated();
+//        setFocus();
+//    }
+//    
+//    public void setFocus(){
+//        SwingUtilities.invokeLater( 
+//            new Runnable() {
+//                public void run(){
+//                    Debug.logInfo( "isEditable in setFocus :" + m_focused.isEditable(), "======================================" );
+//                    Debug.logInfo( "isEnabled in setFocus: " + m_focused.isEnabled(), "======================================" );
+//                    Debug.logInfo( "isFocusable in setFocus :" + m_focused.isFocusable(), "======================================" );                    
+//                    m_focused.requestFocusInWindow();
+//                }
+//            }      
+//        );
+//    }
+//
+//    /**
+//     * @param m_focused the m_focused to set
+//     */
+//    public void setM_focused(XEdit focused) {
+//        Debug.logInfo( "isEditable in setM_focused :" + focused.isEditable(), "======================================" );
+//        Debug.logInfo( "isEnabled in setM_focused :" + focused.isEnabled(), "======================================" );
+//        Debug.logInfo( "isFocusable in setM_focused :" + focused.isFocusable(), "======================================" );                            
+//        this.m_focused = focused;
+//    }
+//}
\ No newline at end of file

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/XFocusDialog.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/XFocusDialog.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/XFocusDialog.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain