Author: jleroux
Date: Mon Oct 26 13:49:50 2009
New Revision: 829799
URL:
http://svn.apache.org/viewvc?rev=829799&view=revLog:
Parameters for sentinel characters while swapping card
Modified:
ofbiz/trunk/specialpurpose/pos/config/parameters.properties
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ClientProfile.java
Modified: ofbiz/trunk/specialpurpose/pos/config/parameters.properties
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/config/parameters.properties?rev=829799&r1=829798&r2=829799&view=diff==============================================================================
--- ofbiz/trunk/specialpurpose/pos/config/parameters.properties (original)
+++ ofbiz/trunk/specialpurpose/pos/config/parameters.properties Mon Oct 26 13:49:50 2009
@@ -24,6 +24,9 @@
# Used with MSR to allow to force swiping from card when showKeyboardInSaveSale is also true
# For instance the card number in Client Profile screen. False by default
SwipWithCard=N
+# Start and End default Sentinel characters (see
http://en.wikipedia.org/wiki/Magnetic_stripe_card)
+StartSentinel=;
+EndSentinel=?
# Reference needed when paying by a credit card with an external payment. True by default.
# Actually the best in such case is to set any payment methods, then NO_PAYMENT is used and works like a charm
PosRefNum=Y
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=829799&r1=829798&r2=829799&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 Mon Oct 26 13:49:50 2009
@@ -79,10 +79,12 @@
protected static PosTransaction m_trans = null;
protected String m_type = null;
protected boolean cancelled = false;
- private static boolean SWIP_WITH_CARD = UtilProperties.propertyValueEqualsIgnoreCase("parameters", "SwipWithCard", "N");
+ private static final Boolean SWIP_WITH_CARD = UtilProperties.propertyValueEqualsIgnoreCase("parameters", "SwipWithCard", "Y");
+ private static final String START_SENTINEL = UtilProperties.getPropertyValue("parameters", "StartSentinel", ";");
+ private static final String END_SENTINEL = UtilProperties.getPropertyValue("parameters", "EndSentinel", "?");
private static Locale locale = Locale.getDefault();
private String m_partyId = null;
- protected StatusBar statusbar = 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
@@ -230,7 +232,7 @@
} else {
String card = m_cardEdit.getText();
if (SWIP_WITH_CARD && UtilValidate.isNotEmpty(m_cardEdit.getText())
- && (card.startsWith(";") && card.endsWith("&"))) {
+ && (card.startsWith(START_SENTINEL) && card.endsWith(END_SENTINEL))) {
m_cardEdit.setText(card.substring(1, card.length() - 1));
}
}