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 2009/10/24 18:45:46 UTC
svn commit: r829406 - in /ofbiz/trunk/specialpurpose/pos: config/
screens/800x600/ screens/800x600/includes/ screens/default/
screens/default/includes/ src/org/ofbiz/pos/component/
src/org/ofbiz/pos/event/ src/org/ofbiz/pos/screen/
Author: jleroux
Date: Sat Oct 24 16:45:45 2009
New Revision: 829406
URL: http://svn.apache.org/viewvc?rev=829406&view=rev
Log:
Add a status bar to the POS.
Purposely only used (visible fields) for now in the Promo Panel, to show possible promo or/and customer selected.
This to allow further status fields later, related to other panels
Added:
ofbiz/trunk/specialpurpose/pos/screens/800x600/includes/statusbar.xml
ofbiz/trunk/specialpurpose/pos/screens/default/includes/statusbar.xml
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/StatusBar.java
Modified:
ofbiz/trunk/specialpurpose/pos/config/PosUiLabels.xml
ofbiz/trunk/specialpurpose/pos/screens/800x600/mgrpanel.xml
ofbiz/trunk/specialpurpose/pos/screens/800x600/paypanel.xml
ofbiz/trunk/specialpurpose/pos/screens/800x600/pospanel.xml
ofbiz/trunk/specialpurpose/pos/screens/800x600/promopanel.xml
ofbiz/trunk/specialpurpose/pos/screens/default/mgrpanel.xml
ofbiz/trunk/specialpurpose/pos/screens/default/paypanel.xml
ofbiz/trunk/specialpurpose/pos/screens/default/pospanel.xml
ofbiz/trunk/specialpurpose/pos/screens/default/promopanel.xml
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ClientProfile.java
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java
Modified: ofbiz/trunk/specialpurpose/pos/config/PosUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/config/PosUiLabels.xml?rev=829406&r1=829405&r2=829406&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/config/PosUiLabels.xml (original)
+++ ofbiz/trunk/specialpurpose/pos/config/PosUiLabels.xml Sat Oct 24 16:45:45 2009
@@ -76,7 +76,7 @@
<value xml:lang="zh">æ¶é¶å:</value>
</property>
<property key="PosClientProfile">
- <value xml:lang="en">Client informations, selection adds the card# as a promo code</value>
+ <value xml:lang="en">Client informations, selection adds the card number as a promo code</value>
<value xml:lang="fr">Informations sur le client, sa sélection entraîne celle de son n° de carte comme code promo</value>
</property>
<property key="PosConfigureItem">
@@ -131,6 +131,10 @@
<value xml:lang="ro">CARTE DE CREDIT</value>
<value xml:lang="zh">ä¿¡ç¨å¡</value>
</property>
+ <property key="PosCustomer">
+ <value xml:lang="en">Customer:</value>
+ <value xml:lang="fr">Client :</value>
+ </property>
<property key="PosDate">
<value xml:lang="en">DATE</value>
<value xml:lang="es">FECHA</value>
@@ -364,6 +368,10 @@
<value xml:lang="ro">Executie plati...</value>
<value xml:lang="zh">å¤çæ¯ä»...</value>
</property>
+ <property key="PosPromoCode">
+ <value xml:lang="en">Promo code:</value>
+ <value xml:lang="fr">Code de promotion :</value>
+ </property>
<property key="PosQty">
<value xml:lang="en">QTY</value>
<value xml:lang="es">Cantidad</value>
Added: ofbiz/trunk/specialpurpose/pos/screens/800x600/includes/statusbar.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/screens/800x600/includes/statusbar.xml?rev=829406&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/screens/800x600/includes/statusbar.xml (added)
+++ ofbiz/trunk/specialpurpose/pos/screens/800x600/includes/statusbar.xml Sat Oct 24 16:45:45 2009
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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>
+ <Components>
+ <Panel name="statusbar" x="0" y="0" w="800" h="20" border="0" style="panel">
+ <Edit name="statusbarClient" x="2" y="0" w="482" h="20" style="operTitle" border="0" alignment="left"/>
+ <Edit name="statusbarPromoCode" x="485" y="" w="312" h="20" style="operTitle" border="0" alignment="right"/>
+ </Panel>
+ </Components>
+</XPage>
Modified: ofbiz/trunk/specialpurpose/pos/screens/800x600/mgrpanel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/screens/800x600/mgrpanel.xml?rev=829406&r1=829405&r2=829406&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/screens/800x600/mgrpanel.xml (original)
+++ ofbiz/trunk/specialpurpose/pos/screens/800x600/mgrpanel.xml Sat Oct 24 16:45:45 2009
@@ -32,6 +32,9 @@
<Panel name="numericPanel" x="320" y="356" w="480" h="210" style="menu">
<Include file="800x600/includes/numeric"/>
</Panel>
+ <Panel name="statusPanel" x="0" y="580" w="800" h="20" style="operTitle" border="0">
+ <Include file="800x600/includes/statusbar"/>
+ </Panel>
</Panel>
</Components>
</XPage>
Modified: ofbiz/trunk/specialpurpose/pos/screens/800x600/paypanel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/screens/800x600/paypanel.xml?rev=829406&r1=829405&r2=829406&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/screens/800x600/paypanel.xml (original)
+++ ofbiz/trunk/specialpurpose/pos/screens/800x600/paypanel.xml Sat Oct 24 16:45:45 2009
@@ -32,6 +32,9 @@
<Panel name="numericPanel" x="320" y="356" w="480" h="210" style="menu">
<Include file="800x600/includes/numeric"/>
</Panel>
+ <Panel name="statusPanel" x="0" y="580" w="800" h="20" style="operTitle" border="0">
+ <Include file="800x600/includes/statusbar"/>
+ </Panel>
</Panel>
</Components>
</XPage>
Modified: ofbiz/trunk/specialpurpose/pos/screens/800x600/pospanel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/screens/800x600/pospanel.xml?rev=829406&r1=829405&r2=829406&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/screens/800x600/pospanel.xml (original)
+++ ofbiz/trunk/specialpurpose/pos/screens/800x600/pospanel.xml Sat Oct 24 16:45:45 2009
@@ -32,6 +32,9 @@
<Panel name="numericPanel" x="320" y="356" w="480" h="220" style="menu">
<Include file="800x600/includes/numeric"/>
</Panel>
+ <Panel name="statusPanel" x="0" y="580" w="800" h="20" style="operTitle" border="0">
+ <Include file="800x600/includes/statusbar"/>
+ </Panel>
</Panel>
</Components>
</XPage>
Modified: ofbiz/trunk/specialpurpose/pos/screens/800x600/promopanel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/screens/800x600/promopanel.xml?rev=829406&r1=829405&r2=829406&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/screens/800x600/promopanel.xml (original)
+++ ofbiz/trunk/specialpurpose/pos/screens/800x600/promopanel.xml Sat Oct 24 16:45:45 2009
@@ -32,6 +32,9 @@
<Panel name="numericPanel" x="320" y="356" w="480" h="220" style="menu">
<Include file="800x600/includes/numeric"/>
</Panel>
+ <Panel name="statusPanel" x="0" y="580" w="800" h="20" style="operTitle" border="0">
+ <Include file="800x600/includes/statusbar"/>
+ </Panel>
</Panel>
</Components>
</XPage>
Added: ofbiz/trunk/specialpurpose/pos/screens/default/includes/statusbar.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/screens/default/includes/statusbar.xml?rev=829406&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/screens/default/includes/statusbar.xml (added)
+++ ofbiz/trunk/specialpurpose/pos/screens/default/includes/statusbar.xml Sat Oct 24 16:45:45 2009
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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>
+ <Components>
+ <Panel name="statusbar" x="0" y="0" w="1024" h="20" border="0" style="panel">
+ <Edit name="statusbarClient" x="2" y="0" w="618" h="20" style="operTitle" border="0" alignment="left"/>
+ <Edit name="statusbarPromoCode" x="620" y="" w="400" h="20" style="operTitle" border="0" alignment="right"/>
+ </Panel>
+ </Components>
+</XPage>
Modified: ofbiz/trunk/specialpurpose/pos/screens/default/mgrpanel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/screens/default/mgrpanel.xml?rev=829406&r1=829405&r2=829406&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/screens/default/mgrpanel.xml (original)
+++ ofbiz/trunk/specialpurpose/pos/screens/default/mgrpanel.xml Sat Oct 24 16:45:45 2009
@@ -32,6 +32,9 @@
<Panel name="numericPanel" x="412" y="455" w="612" h="290" style="menu">
<Include file="default/includes/numeric"/>
</Panel>
+ <Panel name="statusPanel" x="0" y="744" w="1024" h="20" style="operTitle" border="0">
+ <Include file="default/includes/statusbar"/>
+ </Panel>
</Panel>
</Components>
</XPage>
\ No newline at end of file
Modified: ofbiz/trunk/specialpurpose/pos/screens/default/paypanel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/screens/default/paypanel.xml?rev=829406&r1=829405&r2=829406&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/screens/default/paypanel.xml (original)
+++ ofbiz/trunk/specialpurpose/pos/screens/default/paypanel.xml Sat Oct 24 16:45:45 2009
@@ -32,6 +32,9 @@
<Panel name="numericPanel" x="412" y="455" w="612" h="290" style="menu">
<Include file="default/includes/numeric"/>
</Panel>
+ <Panel name="statusPanel" x="0" y="744" w="1024" h="20" style="operTitle" border="0">
+ <Include file="default/includes/statusbar"/>
+ </Panel>
</Panel>
</Components>
</XPage>
\ No newline at end of file
Modified: ofbiz/trunk/specialpurpose/pos/screens/default/pospanel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/screens/default/pospanel.xml?rev=829406&r1=829405&r2=829406&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/screens/default/pospanel.xml (original)
+++ ofbiz/trunk/specialpurpose/pos/screens/default/pospanel.xml Sat Oct 24 16:45:45 2009
@@ -32,6 +32,9 @@
<Panel name="numericPanel" x="412" y="455" w="612" h="290" style="menu">
<Include file="default/includes/numeric"/>
</Panel>
+ <Panel name="statusPanel" x="0" y="744" w="1024" h="20" style="operTitle" border="0">
+ <Include file="default/includes/statusbar"/>
+ </Panel>
</Panel>
</Components>
</XPage>
Modified: ofbiz/trunk/specialpurpose/pos/screens/default/promopanel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/screens/default/promopanel.xml?rev=829406&r1=829405&r2=829406&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/screens/default/promopanel.xml (original)
+++ ofbiz/trunk/specialpurpose/pos/screens/default/promopanel.xml Sat Oct 24 16:45:45 2009
@@ -32,6 +32,9 @@
<Panel name="numericPanel" x="412" y="455" w="612" h="290" style="menu">
<Include file="default/includes/numeric"/>
</Panel>
+ <Panel name="statusPanel" x="0" y="744" w="1024" h="20" style="operTitle" border="0">
+ <Include file="default/includes/statusbar"/>
+ </Panel>
</Panel>
</Components>
</XPage>
\ No newline at end of file
Added: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/StatusBar.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/StatusBar.java?rev=829406&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/StatusBar.java (added)
+++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/StatusBar.java Sat Oct 24 16:45:45 2009
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.component;
+
+import java.util.Locale;
+
+import net.xoetrope.swing.XEdit;
+
+import org.ofbiz.base.util.UtilProperties;
+import org.ofbiz.pos.PosTransaction;
+import org.ofbiz.pos.screen.PosScreen;
+
+public class StatusBar {
+
+ protected XEdit statusbarPromoCode = null;
+ protected XEdit statusbarClient = null;
+ private String customer = (UtilProperties.getMessage(PosTransaction.resource, "PosCustomer", Locale.getDefault()));
+ private String promoCode = (UtilProperties.getMessage(PosTransaction.resource, "PosPromoCode", Locale.getDefault()));
+
+
+ public StatusBar(PosScreen page) {
+ statusbarClient = (XEdit) page.findComponent("statusbarClient");
+ statusbarClient.setFocusable(false);
+ statusbarPromoCode = (XEdit) page.findComponent("statusbarPromoCode");
+ statusbarPromoCode.setFocusable(false);
+ clearClient();
+ clearPromoCode();
+ }
+
+ public void printPromoCode(String message) {
+ statusbarPromoCode.setText(promoCode + " " + message);
+ }
+
+ public void printClient(String message) {
+ statusbarClient.setText(customer + " " +
+ message);
+ }
+
+ public void clearPromoCode() {
+ statusbarPromoCode.setText("");
+ }
+
+ public void clearClient() {
+ statusbarClient.setText("");
+ }
+}
Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java?rev=829406&r1=829405&r2=829406&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java (original)
+++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java Sat Oct 24 16:45:45 2009
@@ -25,6 +25,7 @@
import org.ofbiz.pos.PosTransaction;
import org.ofbiz.pos.component.Input;
import org.ofbiz.pos.component.Output;
+import org.ofbiz.pos.component.StatusBar;
import org.ofbiz.pos.screen.PosScreen;
public class PromoEvents {
@@ -53,6 +54,8 @@
input.clearFunction("PROMOCODE");
} else {
input.clearFunction("PROMOCODE");
+ StatusBar statusbar = new StatusBar(pos);
+ statusbar.printPromoCode(promoCode);
NavagationEvents.showPosScreen(pos);
pos.refresh();
}
Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ClientProfile.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ClientProfile.java?rev=829406&r1=829405&r2=829406&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ClientProfile.java (original)
+++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ClientProfile.java Sat Oct 24 16:45:45 2009
@@ -43,6 +43,7 @@
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.pos.PosTransaction;
+import org.ofbiz.pos.component.StatusBar;
@SuppressWarnings("serial")
@@ -81,6 +82,7 @@
private static boolean SWIP_WITH_CARD = UtilProperties.propertyValueEqualsIgnoreCase("parameters", "SwipWithCard", "N");
private static Locale locale = Locale.getDefault();
private String m_partyId = null;
+ protected StatusBar statusbar = null;
//TODO : make getter and setter for members (ie m_*) if needed (extern calls). For that in Eclipse use Source/Generate Getters and setters
@@ -146,11 +148,15 @@
}
if (UtilValidate.isNotEmpty(person)) {
String promoCode = person.getString("cardId");
- if (UtilValidate.isNotEmpty(promoCode)) {
+ if (UtilValidate.isNotEmpty(promoCode)) {
String result = m_trans.addProductPromoCode(promoCode);
- if(UtilValidate.isNotEmpty(result)) {
+ statusbar = new StatusBar(m_pos);
+ if (UtilValidate.isEmpty(result)) {
+ statusbar.printClient(person.getString("lastName"));
+ statusbar.printPromoCode(promoCode);
+ } else {
m_pos.showDialog("dialog/error/exception", result);
- }
+ }
}
}
}
Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java?rev=829406&r1=829405&r2=829406&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java (original)
+++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java Sat Oct 24 16:45:45 2009
@@ -45,8 +45,10 @@
import org.ofbiz.pos.component.Operator;
import org.ofbiz.pos.component.Output;
import org.ofbiz.pos.component.PosButton;
+import org.ofbiz.pos.component.StatusBar;
import org.ofbiz.pos.device.DeviceLoader;
+@SuppressWarnings("serial")
public class PosScreen extends XPage implements Runnable, DialogCallback, FocusListener {
@@ -73,6 +75,7 @@
protected String scrLocation = null;
protected boolean isLocked = false;
protected boolean inDialog = false;
+ protected StatusBar statusBar = null;
private Locale defaultLocale = Locale.getDefault();
@@ -92,10 +95,11 @@
// setup the shared components
this.session = XuiContainer.getSession();
- this.output = new Output(this);
+ this.output = new Output(this);
this.input = new InputWithPassword(this);
this.journal = new Journal(this);
this.operator = new Operator(this);
+ this.statusBar = new StatusBar(this);
this.setLastActivity(System.currentTimeMillis());
if (!firstInit) {