From: Anneli <an...@us...> - 2005-01-17 10:23:31
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/payment In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17783/src/org/redpos/client/payment Added Files: SimpleCurrencyExchangePayment.java Log Message: New type of payment SimpleCurrencyExchange, enter rate on one currency in properties.xml, when using this payment type the amount will be shown in the currency entered, this is just for the gui part, no info about rate or will be saved in the database. --- NEW FILE: SimpleCurrencyExchangePayment.java --- /* * RedPOS, the OpenSource Point of Sale * * Copyright (C) 2004-2007 Redpill AB * * This application is free software; you can redistribute * it and/or modify it under the terms of the GNU Lesser * General Public License as published by the Free Software * Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This application is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this application; if not, it can be downloaded * from http://www.gnu.org/licenses/lgpl.html. * * For more information and contacts, please visit http://www.redpos.org * */ package org.redpos.client.payment; import org.redpos.amount.Amount; import org.redpos.client.contract.properties.PropertiesUtility; import org.redpos.client.payment.contract.PaymentException; /** * Type of payment * * @version <tt>$Revision: 1.1 $</tt> * @author <a href="mailto:an...@us...">anba</a> * * @jmx.mbean name = "RedPOS.client.payment:service=SimpleCurrencyExchange" * description = "RedPOS client cash payment" * extends = "org.redpos.client.payment.PaymentMBean" */ public class SimpleCurrencyExchangePayment extends PaymentMBeanSupport implements SimpleCurrencyExchangePaymentMBean { /** * @see org.redpos.client.payment.PaymentMBeanSupport#validateAmount(org.redpos.amount.Amount, * org.redpos.amount.Amount) */ public void validateAmount(Amount amountToPay, Amount enteredPayAmount) throws PaymentException { super.validateAmount(amountToPay, enteredPayAmount); } /** * @see org.jboss.system.ServiceMBeanSupport#startService() */ protected void startService() throws Exception { super.startService(); setName(getLanguageString("client.payment.simplecurrencyexchange.name.text", "SimpleCurrencyExchange")); setReceiptText(getLanguageString("client.payment.simplecurrencyexchange.receipt.text", "SimpleCurrencyExchange")); getLog().info("Started SimpleCurrencyExchangePayment service: " + getName()); // get settings from properties // PropertiesUtility po = new PropertiesUtility(this.getServer()); setIndex((Integer)po.getProperty("payments", "simplecurrencyexchangeindex")); setCode((String)po.getProperty("payments", "simplecurrencyexchangecode")); setChangeAllowed(((Boolean)po.getProperty("payments", "simplecurrencyexchangechangeallowed")).booleanValue()); setRepayAllowed(((Boolean)po.getProperty("payments", "simplecurrencyexchangerepayallowed")).booleanValue()); setCancelAllowed(((Boolean)po.getProperty("payments", "simplecurrencyexchangecancelallowed")).booleanValue()); setUpdateAllowed(((Boolean)po.getProperty("payments", "simplecurrencyexchangeupdateallowed")).booleanValue()); setLimit(((Double)po.getProperty("payments", "simplecurrencyexchangelimit")).doubleValue()); setLimitChange(((Double)po.getProperty("payments", "simplecurrencyexchangelimitchange")).doubleValue()); setLimitRepay(((Double)po.getProperty("payments", "simplecurrencyexchangelimitrepay")).doubleValue()); } } |