svn commit: r707914 - in /ofbiz/trunk/specialpurpose/pos: config/XuiLabels.properties config/XuiLabels_fr.properties screens/default/dialog/PaidInOut.xml src/org/ofbiz/pos/event/ManagerEvents.java 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: r707914 - in /ofbiz/trunk/specialpurpose/pos: config/XuiLabels.properties config/XuiLabels_fr.properties screens/default/dialog/PaidInOut.xml src/org/ofbiz/pos/event/ManagerEvents.java src/org/ofbiz/pos/screen/PaidInOut.java

jleroux@apache.org
Author: jleroux
Date: Sat Oct 25 15:54:41 2008
New Revision: 707914

URL: http://svn.apache.org/viewvc?rev=707914&view=rev
Log:
Add a "Reason comment" text field to allow the admin put a comment to better qualify the Paid in/out reason (put more details, etc.).
PosTerminalInternTx.reasonComment field stores the comment.
I also sorted Xuilabels.properties and Xuilabels_fr.properties contents

Modified:
    ofbiz/trunk/specialpurpose/pos/config/XuiLabels.properties
    ofbiz/trunk/specialpurpose/pos/config/XuiLabels_fr.properties
    ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidInOut.xml
    ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java
    ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java

Modified: ofbiz/trunk/specialpurpose/pos/config/XuiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/config/XuiLabels.properties?rev=707914&r1=707913&r2=707914&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/config/XuiLabels.properties (original)
+++ ofbiz/trunk/specialpurpose/pos/config/XuiLabels.properties Sat Oct 25 15:54:41 2008
@@ -33,6 +33,7 @@
 CONFIG_ITEM=Item Configuration
 CREDIT=CREDIT
 Cancel=Cancel
+reasonCommentInOut=Comment
 DEL=DEL
 Delete=Delete
 ENT=ENT
@@ -42,6 +43,8 @@
 FUNCTION_NOT_YET_SUPPORTED=FUNCTION NOT YET SUPPORTED
 GIFT_CERT=GIFT CERT
 INVALID_CARD_NUMBER=INVALID CARD NUMBER
+INVALID_EXPIRATION_DATE=The expiration date should be 4 digits.
+INVALID_SECURITY_CODE=The security code should be 3 or 4 digits.
 ITEM_DISC=ITEM DISC
 ITEM_MODIFICATION_ERROR=ITEM MODIFICATION ERROR
 LANG=LANG
@@ -87,10 +90,9 @@
 UNKNOWN_CARD_TYPE=UNKNOWN CARD TYPE
 VOID_ITEM=VOID ITEM
 VOID_SALE=VOID SALE
+
 item_not_configurable=The selected item is not configurable.
 no_sales=No sales saved
 order_not_found=ORDER NOT FOUND
 problems_reading_card=PROBLEMS READING SWIPED CARD
-product_not_found=PRODUCT NOT FOUND
-INVALID_EXPIRATION_DATE=The expiration date should be 4 digits.
-INVALID_SECURITY_CODE=The security code should be 3 or 4 digits.
+product_not_found=PRODUCT NOT FOUND
\ No newline at end of file

Modified: ofbiz/trunk/specialpurpose/pos/config/XuiLabels_fr.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/config/XuiLabels_fr.properties?rev=707914&r1=707913&r2=707914&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/config/XuiLabels_fr.properties (original)
+++ ofbiz/trunk/specialpurpose/pos/config/XuiLabels_fr.properties Sat Oct 25 15:54:41 2008
@@ -33,6 +33,7 @@
 CONFIG_ITEM=Configurer l'article
 CREDIT=Cr\u00e9dit
 Cancel=Annuler
+reasonCommentInOut=Commentaire
 DEL=Suppr.
 Delete=Supprimer
 ENT=Valider
@@ -42,6 +43,8 @@
 FUNCTION_NOT_YET_SUPPORTED=Fonction non encore support\u00e9e
 GIFT_CERT=Bon d'achat
 INVALID_CARD_NUMBER=N\u00b0 de carte non valide
+INVALID_EXPIRATION_DATE=La date d'expiration doit comporter 4 chiffres
+INVALID_SECURITY_CODE=Le code doit comporter 3 ou 4 chiffres.
 ITEM_DISC=Remise sur l'article
 ITEM_MODIFICATION_ERROR=Erreur lors de la modification de l'article
 LANG=Langage
@@ -87,11 +90,10 @@
 UNKNOWN_CARD_TYPE=Type de carte inconnu
 VOID_ITEM=Annuler l'article
 VOID_SALE=Annuler la vente
+
 item_not_configurable=Article non configurable
 no_sales=Aucune vente sauv\u00e9e
 order_not_found=N\u00b0 de transaction inconnu !
 problems_reading_card=Probl\u00e8me lors de la lecture de la carte
 product_not_found=Produit inconnu !
-promo_page=Ce sera la page des promotions...
-INVALID_EXPIRATION_DATE=La date d'expiration doit comporter 4 chiffres
-INVALID_SECURITY_CODE=Le code doit comporter 3 ou 4 chiffres.
+promo_page=Ce sera la page des promotions...
\ No newline at end of file

Modified: ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidInOut.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidInOut.xml?rev=707914&r1=707913&r2=707914&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidInOut.xml (original)
+++ ofbiz/trunk/specialpurpose/pos/screens/default/dialog/PaidInOut.xml Sat Oct 25 15:54:41 2008
@@ -19,11 +19,13 @@
 -->
 <XPage class="net.xoetrope.swing.XDialog" resource="">
     <Components>
-        <Panel name="InOutPanel" x="0" y="0" w="680" h="150" style="menu">
+        <Panel name="InOutPanel" x="0" y="0" w="680" h="200" 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"/>
+            <Label name="reasonLabel" x="20" y="90" w="100" h="40" content="ReasonInOut" style="editAndList"/>
+            <ComboBox name="reasonCombo" x="120" y="80" w="300" h="40" editable="false" style="editAndList"/>
+            <Label name="reasonCommentLabel" x="20" y="140" w="100" h="40" content="reasonCommentInOut" style="editAndList"/>
+            <Edit name="reasonCommentEdit"  x="120" y="130" w="300" h="40" 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>

Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java?rev=707914&r1=707913&r2=707914&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java (original)
+++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java Sat Oct 25 15:54:41 2008
@@ -444,7 +444,7 @@
                 Debug.logError(pe, module);
                 return;
             }
-            internTx.set("reasonComment", mapInOut.get("reason"));
+            internTx.set("reasonComment", mapInOut.get("reasonComment"));
             internTx.set("reasonEnumId", mapInOut.get("reason"));
             try {
                 internTx.create();

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=707914&r1=707913&r2=707914&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 Sat Oct 25 15:54:41 2008
@@ -19,7 +19,6 @@
 package org.ofbiz.pos.screen;
 
 import java.util.HashMap;
-import java.util.Hashtable;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -38,6 +37,7 @@
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.base.util.UtilProperties;
+import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
 import org.ofbiz.pos.PosTransaction;
@@ -56,7 +56,9 @@
     protected XLabel m_amoutLabel = null;
     protected XEdit m_amountEdit = null;
     protected XLabel m_reasonLabel = null;
-    protected XComboBox m_reasonsCombo = null;
+    protected XComboBox m_reasonCombo = null;
+    protected XLabel m_reasonCommentLabel = null;
+    protected XEdit m_reasonCommentEdit = null;
     protected XButton m_cancel = null;
     protected XButton m_ok = null;
     protected DefaultComboBoxModel m_comboModel = null;
@@ -75,13 +77,17 @@
 
     public Map<String, String> openDlg() {
         m_dialog = (XDialog) pageMgr.loadPage(m_pos.getScreenLocation() + "/dialog/PaidInOut");
+        m_amoutLabel = (XLabel) m_dialog.findComponent("amoutLabel");
         m_amountEdit = (XEdit) m_dialog.findComponent("amountEdit");
-        m_reasonsCombo = (XComboBox) m_dialog.findComponent("ReasonsCombo");
+
+        m_reasonLabel = (XLabel) m_dialog.findComponent("reasonLabel");
+        m_reasonCombo = (XComboBox) m_dialog.findComponent("reasonCombo");
+
+        m_reasonCommentLabel = (XLabel) m_dialog.findComponent("reasonCommentLabel");
+        m_reasonCommentEdit = (XEdit) m_dialog.findComponent("reasonCommentEdit");
 
         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");
         Locale locale = Locale.getDefault();
 
         XEventHelper.addMouseHandler(this, m_cancel, "cancel");
@@ -107,17 +113,19 @@
         for (GenericValue reason : posPaidReasons) {
             m_comboModel.addElement(reason.get("description", locale));
         }
-        m_reasonsCombo.setModel(m_comboModel);
-        m_reasonsCombo.setToolTipText(UtilProperties.getMessage(PosTransaction.resource, "CreateOrChooseReasonInOut", locale));
+        m_reasonCombo.setModel(m_comboModel);
+        m_reasonCombo.setToolTipText(UtilProperties.getMessage(PosTransaction.resource, "CreateOrChooseReasonInOut", locale));
 
         m_dialog.pack();
-        m_reasonsCombo.requestFocusInWindow();
+        m_reasonCombo.requestFocusInWindow();
         m_dialog.showDialog(this);
         if (cancelled) {
-            return new HashMap();
+            return new HashMap<String, String>();
         } else {
-            return UtilMisc.toMap("amount", m_amountEdit.getText(), "reason", (String) m_reasonsCombo.getSelectedItem());
-        }
+            return UtilMisc.toMap("amount", m_amountEdit.getText(),
+                    "reason", (String)(posPaidReasons.get(m_reasonCombo.getSelectedIndex())).get("enumId"),        
+                    "reasonComment", (String) m_reasonCommentEdit.getText());        
+            }
     }
 
     public synchronized void cancel() {
@@ -130,8 +138,8 @@
     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 ) {
+            String reason = (String) m_reasonCombo.getSelectedItem();
+            if (UtilValidate.isNotEmpty(amount)&& UtilValidate.isNotEmpty(reason)) {
                 m_dialog.closeDlg();
             }
         }
@@ -151,5 +159,4 @@
         }
         return;
     }
-
 }